Bug 235389 - Create ancestry of isolated objects instead of generating the entire subtree for an ancestor.
Summary: Create ancestry of isolated objects instead of generating the entire subtree ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-19 18:20 PST by Andres Gonzalez
Modified: 2022-01-22 10:18 PST (History)
11 users (show)

See Also:


Attachments
Patch (2.79 KB, patch)
2022-01-19 18:29 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (6.64 KB, patch)
2022-01-20 16:03 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (7.40 KB, patch)
2022-01-21 11:34 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2022-01-19 18:20:47 PST
Create ancestry of isolated objects instead of generating the entire subtree for an ancestor.
Comment 1 Radar WebKit Bug Importer 2022-01-19 18:20:57 PST
<rdar://problem/87803473>
Comment 2 Andres Gonzalez 2022-01-19 18:29:22 PST
Created attachment 449541 [details]
Patch
Comment 3 Andres Gonzalez 2022-01-19 18:29:26 PST
<rdar://problem/87803473>
Comment 4 Andres Gonzalez 2022-01-20 16:03:39 PST
Created attachment 449617 [details]
Patch
Comment 5 Tyler Wilcock 2022-01-21 10:07:12 PST
Comment on attachment 449617 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        No new tests (OOPS!).

I think commit queue will fail if this line is still in the patch.

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:230
> +void AXIsolatedTree::addChanges(const NodeChange& nodeChange, Vector<AXID>&& childrenIDs)

Would naming this something like `queueChanges` be more informative of what this method is doing?

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:348
> +        auto* axParent = ancestor.parentObject();

parentObject() includes ignored objects (vs. parentObjectUnignored()). Is that OK? It seems our implementation of AXIsolatedObject::parentObjectUnignored assumes the parent is unignored, so adding an ignored object to the tree might break that assumption?

AXCoreObject* AXIsolatedObject::parentObjectUnignored() const
{
    return tree()->nodeForID(parent()).get();
}
Comment 6 chris fleizach 2022-01-21 10:26:04 PST
Comment on attachment 449617 [details]
Patch

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

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:205
> +AXIsolatedTree::NodeChange AXIsolatedTree::createNodeChange(AXCoreObject& axObject, AXID parentID, bool attachWrapper)

What does this give us by removing the Ref on the returned object?
the word create, at least at apple, usually implies a new object is allocated that is retained. wonder if this name should be different
Comment 7 Andres Gonzalez 2022-01-21 11:34:41 PST
Created attachment 449675 [details]
Patch
Comment 8 Andres Gonzalez 2022-01-21 11:43:30 PST
(In reply to Tyler Wilcock from comment #5)
> Comment on attachment 449617 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449617&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        No new tests (OOPS!).
> 
> I think commit queue will fail if this line is still in the patch.

That was strange, it was correct in my local copy, so I must have uploaded the patch without saving the ChangeLog.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:230
> > +void AXIsolatedTree::addChanges(const NodeChange& nodeChange, Vector<AXID>&& childrenIDs)
> 
> Would naming this something like `queueChanges` be more informative of what
> this method is doing?

Yes! thanks, done.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:348
> > +        auto* axParent = ancestor.parentObject();
> 
> parentObject() includes ignored objects (vs. parentObjectUnignored()). Is
> that OK? It seems our implementation of
> AXIsolatedObject::parentObjectUnignored assumes the parent is unignored, so
> adding an ignored object to the tree might break that assumption?
> 
> AXCoreObject* AXIsolatedObject::parentObjectUnignored() const
> {
>     return tree()->nodeForID(parent()).get();
> }

We may need to revisit this since that could create inconsistencies in the isolated Tre because the parent will not have this object as a child.
Comment 9 Andres Gonzalez 2022-01-21 11:45:07 PST
(In reply to chris fleizach from comment #6)
> Comment on attachment 449617 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449617&action=review
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:205
> > +AXIsolatedTree::NodeChange AXIsolatedTree::createNodeChange(AXCoreObject& axObject, AXID parentID, bool attachWrapper)
> 
> What does this give us by removing the Ref on the returned object?
> the word create, at least at apple, usually implies a new object is
> allocated that is retained. wonder if this name should be different

We are not removing the Ref to the object but storing it in the NodeChange.
I renamed it to nodeChangeForObject.
Comment 10 EWS 2022-01-22 10:18:16 PST
Committed r288405 (246296@main): <https://commits.webkit.org/246296@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449675 [details].