Bug 180503 - Remove nodes from AXObjectCache when the associated subframe document is getting destroyed.
Summary: Remove nodes from AXObjectCache when the associated subframe document is gett...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks: 173540
  Show dependency treegraph
 
Reported: 2017-12-06 14:02 PST by zalan
Modified: 2017-12-06 16:55 PST (History)
16 users (show)

See Also:


Attachments
Patch (9.15 KB, patch)
2017-12-06 14:37 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (9.14 KB, patch)
2017-12-06 14:49 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2017-12-06 14:02:33 PST
rdar://problem/35891328
Comment 1 zalan 2017-12-06 14:37:52 PST
Created attachment 328632 [details]
Patch
Comment 2 chris fleizach 2017-12-06 14:45:24 PST
Comment on attachment 328632 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=328632&action=review

> Source/WebCore/ChangeLog:25
> +        lists are tend to stay small.

those lists tend (strikeout are)
Comment 3 zalan 2017-12-06 14:49:19 PST
Created attachment 328634 [details]
Patch
Comment 4 Nan Wang 2017-12-06 15:04:02 PST
Comment on attachment 328634 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=328634&action=review

> Source/WebCore/accessibility/AXObjectCache.cpp:2729
> +static void filterForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)

Why do we have a typename here for *list* but *nodesToRemove* is limited to <Node*>? 
This won't work if T is not a derived class of Node, right?
Comment 5 zalan 2017-12-06 15:56:25 PST
(In reply to Nan Wang from comment #4)
> Comment on attachment 328634 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=328634&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:2729
> > +static void filterForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
> 
> Why do we have a typename here for *list* but *nodesToRemove* is limited to
> <Node*>? 
> This won't work if T is not a derived class of Node, right?
::remove() takes a Node& so nodesToRemove can't have non-Node based objects.
Comment 6 Nan Wang 2017-12-06 16:04:35 PST
Comment on attachment 328634 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=328634&action=review

>>> Source/WebCore/accessibility/AXObjectCache.cpp:2729
>>> +static void filterForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
>> 
>> Why do we have a typename here for *list* but *nodesToRemove* is limited to <Node*>? 
>> This won't work if T is not a derived class of Node, right?
> 
> ::remove() takes a Node& so nodesToRemove can't have non-Node based objects.

I see. But list has to contain only node based objects right? Why is the template necessary?
Comment 7 zalan 2017-12-06 16:27:01 PST
(In reply to Nan Wang from comment #6)
> Comment on attachment 328634 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=328634&action=review
> 
> >>> Source/WebCore/accessibility/AXObjectCache.cpp:2729
> >>> +static void filterForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
> >> 
> >> Why do we have a typename here for *list* but *nodesToRemove* is limited to <Node*>? 
> >> This won't work if T is not a derived class of Node, right?
> > 
> > ::remove() takes a Node& so nodesToRemove can't have non-Node based objects.
> 
> I see. But list has to contain only node based objects right? Why is the
> template necessary?
Correct. All incoming lists have to contain Node based object. However, while you can pass in an Element* when the function expects Node*, you can't pass in ListHashSet<Element*> for const ListHashSet<Node*>.
Comment 8 Nan Wang 2017-12-06 16:31:50 PST
(In reply to zalan from comment #7)
> (In reply to Nan Wang from comment #6)
> > Comment on attachment 328634 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=328634&action=review
> > 
> > >>> Source/WebCore/accessibility/AXObjectCache.cpp:2729
> > >>> +static void filterForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
> > >> 
> > >> Why do we have a typename here for *list* but *nodesToRemove* is limited to <Node*>? 
> > >> This won't work if T is not a derived class of Node, right?
> > > 
> > > ::remove() takes a Node& so nodesToRemove can't have non-Node based objects.
> > 
> > I see. But list has to contain only node based objects right? Why is the
> > template necessary?
> Correct. All incoming lists have to contain Node based object. However,
> while you can pass in an Element* when the function expects Node*, you can't
> pass in ListHashSet<Element*> for const ListHashSet<Node*>.

I thought it's possible to pass in ListHashSet that holds the derived class objects. But ok then.
Comment 9 WebKit Commit Bot 2017-12-06 16:55:05 PST
Comment on attachment 328634 [details]
Patch

Clearing flags on attachment: 328634

Committed r225613: <https://trac.webkit.org/changeset/225613>
Comment 10 WebKit Commit Bot 2017-12-06 16:55:06 PST
All reviewed patches have been landed.  Closing bug.