-
Notifications
You must be signed in to change notification settings - Fork 1.7k
AX: Add a fast path for assistive technologies that search for all live regions and all non-root web areas on macOS #41898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AX: Add a fast path for assistive technologies that search for all live regions and all non-root web areas on macOS #41898
Conversation
EWS run on previous version of this PR (hash ee7be21) |
ee7be21
to
de7ae33
Compare
EWS run on previous version of this PR (hash de7ae33) |
de7ae33
to
a682fee
Compare
EWS run on previous version of this PR (hash a682fee) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what is the motivation for moving children changed up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the accessibility tree before any calls to addSortedObject
, as otherwise we'll be trying to find the right place for a sorted object based on outdated accessibility tree state. This moves handling children-changed up above where we would potentially call addSortedObject
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't only apply to live regions, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above, this isn't just for live regions, right?
a682fee
to
b192947
Compare
EWS run on current version of this PR (hash b192947) |
…ve regions and all non-root web areas on macOS https://bugs.webkit.org/show_bug.cgi?id=289137 rdar://146185640 Reviewed by Chris Fleizach. VoiceOver commonly sends remote search requests for all the live regions, and all the non-woot web areas on the page. Prior to this commit, this always required a full tree traversal. With this commit, we eagerly maintain a pre-sorted list of these objects, allowing us to answer these queries immediately. There are generally very few of these objects on a page, so it's cheap to keep this list up-to-date. To avoid confusion, the existing AXObjectCache::m_liveRegionObjects list is renamed to AXObjectCache::m_changedLiveRegions, as that is what it actually holds (live regions that have changed and are waiting for notifications to be sent for them). * LayoutTests/accessibility/mac/live-region-search-expected.txt: Added. * LayoutTests/accessibility/mac/live-region-search.html: Added. * Source/WebCore/accessibility/AXCoreObject.h: * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::handleLiveRegionCreated): (WebCore::AXObjectCache::postLiveRegionChangeNotification): (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired): (WebCore::AXObjectCache::handleRoleChanged): (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::performDeferredCacheUpdate): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AXSearchManager.cpp: (WebCore::AXSearchManager::findMatchingObjectsInternal): (WebCore::AXSearchManager::findMatchingRange): (WebCore::AXSearchManager::findNextStartingFrom): (WebCore::AXSearchManager::findAllMatchingObjectsIgnoringCache): * Source/WebCore/accessibility/AXSearchManager.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateRole): * Source/WebCore/accessibility/AccessibilityObject.h: * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * Source/WebCore/accessibility/cocoa/AXCoreObjectCocoa.mm: (WebCore::AXCoreObject::sortedDescendants const): * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::sortedLiveRegions): (WebCore::AXIsolatedTree::sortedNonRootWebAreas): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::sortedLiveRegionsDidChange): (WebCore::AXIsolatedTree::sortedNonRootWebAreasDidChange): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: * Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::allSortedLiveRegions const): (WebCore::AXIsolatedObject::allSortedNonRootWebAreas const): * Source/WebCore/accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::onDocumentRenderTreeCreation): (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): (WebCore::AXObjectCache::sortedLiveRegions const): (WebCore::AXObjectCache::sortedNonRootWebAreas const): (WebCore::AXObjectCache::addSortedObject): (WebCore::AXObjectCache::removeLiveRegion): (WebCore::AXObjectCache::initializeSortedIDLists): * Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::allSortedLiveRegions const): (WebCore::AccessibilityObject::allSortedNonRootWebAreas const): * Source/WebCore/dom/Document.cpp: (WebCore::Document::createRenderTree): Canonical link: https://commits.webkit.org/291652@main
b192947
to
0420ca0
Compare
Committed 291652@main (0420ca0): https://commits.webkit.org/291652@main Reviewed commits have been landed. Closing PR #41898 and removing active labels. |
0420ca0
b192947