Bug 235343 - AX: Remove unnecessary isolated tree update for AXSelectedTextChanged node
Summary: AX: Remove unnecessary isolated tree update for AXSelectedTextChanged node
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-18 16:44 PST by Tyler Wilcock
Modified: 2022-01-19 11:43 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.55 KB, patch)
2022-01-18 17:00 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (3.55 KB, patch)
2022-01-18 17:02 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-01-18 16:44:49 PST
When we get an AXSelectedTextChanged notification, we update the isolated tree with the node that has gained selection. Sometimes this node is not a part of the AX tree, meaning its AXAncestorFlags are not initialized. This results in hitting this ASSERT in AXIsolatedObject::initializeAttributeData:

// For all objects besides the root, the ancestry flags should've been set by now.
ASSERT(isRoot || object.ancestorFlagsAreInitialized());

I don't think updating the isolated tree with this node is necessary. This behavior was added here to fix accessibility/mac/search-text/search-text.html:

https://bugs.webkit.org/show_bug.cgi?id=208434

But the test passes in ITM with and without updating the isolated tree with this node.

Also, for text selection related operations, isolated tree objects currently defer to the main thread (e.g. AXIsolatedObject::selectedText, AXIsolatedObject::selectedText), further leading me to believe this update is unnecessary.
Comment 1 Radar WebKit Bug Importer 2022-01-18 16:45:02 PST
<rdar://problem/87742260>
Comment 2 Tyler Wilcock 2022-01-18 17:00:43 PST
Created attachment 449453 [details]
Patch
Comment 3 Tyler Wilcock 2022-01-18 17:02:23 PST
Created attachment 449454 [details]
Patch
Comment 4 EWS 2022-01-19 11:43:01 PST
Committed r288220 (246180@main): <https://commits.webkit.org/246180@main>

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