Bug 244151

Summary: AX: With isolated tree mode enabled, ignored objects sent along with published notifications cannot be queried by AX clients
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Tyler Wilcock 2022-08-19 18:52:17 PDT
AX: With isolated tree mode enabled, ignored objects sent along with published notifications cannot be queried by AX clients
Comment 1 Radar WebKit Bug Importer 2022-08-19 18:53:41 PDT
<rdar://problem/98908539>
Comment 2 Tyler Wilcock 2022-08-19 19:00:58 PDT
Created attachment 461747 [details]
Patch
Comment 3 chris fleizach 2022-08-19 19:19:42 PDT
Comment on attachment 461747 [details]
Patch

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

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:288
> +    NodeChange nodeChange { isolatedObject, nullptr };

Do we have any asserts for null parents that this will hit

> Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:450
> +static void createIsolatedObjectForNotificationIfNeeded(AXCoreObject& object, std::optional<PageIdentifier> pageID)

ForNorification in the name seems unnecessary

> Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:466
> +        if (object.accessibilityIsIgnored())

We should check ignored status before doing the work of fetching the tree
Comment 4 Tyler Wilcock 2022-08-19 19:36:29 PDT
Created attachment 461750 [details]
Patch
Comment 5 Tyler Wilcock 2022-08-19 19:39:09 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 461747 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=461747&action=review
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:288
> > +    NodeChange nodeChange { isolatedObject, nullptr };
> 
> Do we have any asserts for null parents that this will hit
No, I don't think so. The unconnected isolated object that is created will consider its parent to be the nearest-in-isolated-tree object (which is guaranteed by way of using parentObjectUnignored):

https://github.com/WebKit/WebKit/blob/bb5e3d4d63fbf63b8f79347e70a5b09cdd525ca1/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp#L48

So it will return the right parent when queried. That parent will not include this unconnected isolated object in its children, but I think that's fine and expected in this scenario.
Comment 6 Tyler Wilcock 2022-08-19 19:39:51 PDT
Fixed your other two comments.
Comment 7 Tyler Wilcock 2022-08-20 10:09:03 PDT
Created attachment 461764 [details]
Patch
Comment 8 EWS 2022-08-21 11:11:20 PDT
Committed 253629@main (16a4b06e0306): <https://commits.webkit.org/253629@main>

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