AX: Include ignored objects in the core, platform-agnostic accessibility tree behind a new feature flag#33937
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Sep 28, 2024
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 653874b) Details |
fleizach
reviewed
Sep 20, 2024
fleizach
reviewed
Sep 20, 2024
fleizach
approved these changes
Sep 20, 2024
653874b to
bdbb173
Compare
Collaborator
|
EWS run on previous version of this PR (hash bdbb173) Details
|
bdbb173 to
07fdd42
Compare
Collaborator
|
EWS run on previous version of this PR (hash 07fdd42) Details |
Contributor
Author
|
@fleizach: Addressed all your comments, and made a small change that fixed a ton of tests with |
07fdd42 to
1c5ecac
Compare
Collaborator
|
EWS run on current version of this PR (hash 1c5ecac) Details |
…ity tree behind a new feature flag https://bugs.webkit.org/show_bug.cgi?id=280012 rdar://136316595 Reviewed by Chris Fleizach. This patch adds a compile-time feature flag, ENABLE_INCLUDE_IGNORED_IN_CORE_AX_TREE, and a runtime feature flag, IncludeIgnoredInCoreAXTree, to start including ignored objects in the "core", platform-agnostic accessibility tree. This is necessary to support off-main-thread text marker computation, e.g. for emitting a newline when exiting the accessibility object of an ignored `tr` element, as one of many examples. Prior to this commit, any use of `AXCoreObject::children` implicitly assumed that the returned objects were unignored. With this commit, that function is renamed to `unignoredChildren`, and any context which expected to only process unignored objects now uses it. A new function, `childrenIncludingIgnored` is added, and that is used in a few places. There were several direct usages of `m_children` that were problematic, as `m_children` now includes ignored objects when ENABLE_INCLUDE_IGNORED_IN_CORE_AX_TREE is true. These usages are replaced with unignoredChildren(/* updateChildrenIfNeeded */ false), achieving the same behavior in both configurations with more explicit intent. There are many test failures left to fix in ENABLE_INCLUDE_IGNORED_IN_CORE_AX_TREE with this change (6 ITM off, 60 ITM on). Those will be addressed in follow-up patches. We will also need to find ways to optimize `unignoredChildren`, either by caching the result or something else, as this naive initial implementation does show up heavily in samples since the accessibility tree now has signifcantly more objects to traverse through. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WTF/wtf/PlatformEnableCocoa.h: * Source/WebCore/accessibility/AXCoreObject.cpp: (WebCore::AXCoreObject::tabChildren): (WebCore::AXCoreObject::unignoredChildren): (WebCore::AXCoreObject::nextInPreOrder): (WebCore::AXCoreObject::nextSiblingIncludingIgnored const): (WebCore::AXCoreObject::nextUnignoredSibling const): (WebCore::AXCoreObject::nextUnignoredSiblingOrParent const): (WebCore::AXCoreObject::contents): (WebCore::AXCoreObject::ariaTreeItemContent): (WebCore::AXCoreObject::selectedRadioButton): (WebCore::AXCoreObject::selectedTabItem): (WebCore::AXCoreObject::appendRadioButtonDescendants const): (WebCore::AXCoreObject::parentObjectUnignored const): * Source/WebCore/accessibility/AXCoreObject.h: (WebCore::AXCoreObject::childrenIncludingIgnored): (WebCore::AXCoreObject::unignoredChildren): (WebCore::AXCoreObject::childrenIDs): (WebCore::Accessibility::findUnignoredChild): (WebCore::Accessibility::enumerateUnignoredDescendants): (WebCore::Accessibility::findChild): Deleted. (WebCore::Accessibility::enumerateDescendants): Deleted. * Source/WebCore/accessibility/AXImage.cpp: (WebCore::AXImage::imageOverlayElements): * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::streamSubtree): * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::modalElementHasAccessibleContent): (WebCore::AXObjectCache::focusedImageMapUIElement): (WebCore::AXObjectCache::handleChildrenChanged): * Source/WebCore/accessibility/AXSearchManager.cpp: (WebCore::appendChildrenToArray): * Source/WebCore/accessibility/AXTextMarker.cpp: (WebCore::appendChildren): (WebCore::AXTextMarker::characterRangeForLine const): (WebCore::AXTextMarker::lineNumberForIndex const): * Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp: (WebCore::AccessibilityARIAGridRow::rowHeader): * Source/WebCore/accessibility/AccessibilityLabel.cpp: (WebCore::childrenContainOnlyStaticText): (WebCore::AccessibilityLabel::containsOnlyStaticText const): (WebCore::AccessibilityLabel::updateChildrenIfNecessary): * Source/WebCore/accessibility/AccessibilityList.cpp: (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): (WebCore::AccessibilityList::determineAccessibilityRole): * Source/WebCore/accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::setSelectedChildren): (WebCore::AccessibilityListBox::selectedChildren): (WebCore::AccessibilityListBox::visibleChildren): (WebCore::AccessibilityListBox::elementAccessibilityHitTest const): * Source/WebCore/accessibility/AccessibilityMathMLElement.cpp: (WebCore::AccessibilityMathMLElement::mathRadicand): (WebCore::AccessibilityMathMLElement::mathRootIndexObject): (WebCore::AccessibilityMathMLElement::mathNumeratorObject): (WebCore::AccessibilityMathMLElement::mathDenominatorObject): (WebCore::AccessibilityMathMLElement::mathUnderObject): (WebCore::AccessibilityMathMLElement::mathOverObject): (WebCore::AccessibilityMathMLElement::mathBaseObject): (WebCore::AccessibilityMathMLElement::mathSubscriptObject): (WebCore::AccessibilityMathMLElement::mathSuperscriptObject): * Source/WebCore/accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::didUpdateActiveOption): * Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp: (WebCore::AccessibilityMenuListPopup::selectedChildren): (WebCore::AccessibilityMenuListPopup::handleChildrenChanged): (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption): * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::boundingBoxRect const): (WebCore::AccessibilityNodeObject::visibleChildren): (WebCore::AccessibilityNodeObject::internalLinkElement const): (WebCore::AccessibilityNodeObject::textAsLabelFor const): (WebCore::AccessibilityNodeObject::stringValue const): (WebCore::accessibleNameForNode): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::insertChild): (WebCore::AccessibilityObject::clickPoint): (WebCore::AccessibilityObject::ariaTreeRows): (WebCore::AccessibilityObject::disclosedRows): (WebCore::AccessibilityObject::supportsPressAction const): (WebCore::AccessibilityObject::elementAccessibilityHitTest const): (WebCore::AccessibilityObject::includeIgnoredInCoreTree const): (WebCore::AccessibilityObject::ariaListboxSelectedChildren): (WebCore::AccessibilityObject::selectedListItems): (WebCore::AccessibilityObject::parentObjectUnignored const): Deleted. * Source/WebCore/accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::parentInCoreTree const): * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValue const): (WebCore::AccessibilityRenderObject::documentLinks): (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest const): (WebCore::AccessibilityRenderObject::updateAttachmentViewParents): (WebCore::AccessibilityRenderObject::addNodeOnlyChildren): (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * Source/WebCore/accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::updateChildrenRoles): (WebCore::AccessibilityTable::addChildren): (WebCore::AccessibilityTable::cells): * Source/WebCore/accessibility/AccessibilityTableColumn.cpp: (WebCore::AccessibilityTableColumn::elementRect const): (WebCore::AccessibilityTableColumn::columnHeader): * Source/WebCore/accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::rowHeader): (WebCore::AccessibilityTableRow::addChildren): * Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityElements]): (-[WebAccessibilityObjectWrapper accessibilityElementCount]): (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]): (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]): (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]): (accessibleElementsForObjects): (-[WebAccessibilityObjectWrapper accessibilityIsFirstItemInSuggestion]): (-[WebAccessibilityObjectWrapper accessibilityIsLastItemInSuggestion]): * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::AXIsolatedObject): (WebCore::AXIsolatedObject::initializeProperties): (WebCore::AXIsolatedObject::setProperty): (WebCore::AXIsolatedObject::boolAttributeValue const): (WebCore::AXIsolatedObject::relativeFrameFromChildren const): (WebCore::AXIsolatedObject::sibling const): Deleted. (WebCore::AXIsolatedObject::siblingOrParent const): Deleted. (WebCore::AXIsolatedObject::parentObjectUnignored const): Deleted. * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createEmptyContent): (WebCore::AXIsolatedTree::shouldCreateNodeChange): (WebCore::AXIsolatedTree::collectNodeChangesForSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updatePropertiesForSelfAndDescendants): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::lastMarker): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::isUnconnectedNode const): * Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::textMarkerRange const): * Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm: (WebCore::isEmptyGroup): * Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (transformSpecialChildrenCases): (children): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): Canonical link: https://commits.webkit.org/284418@main
1c5ecac to
f5c7df8
Compare
Collaborator
|
Committed 284418@main (f5c7df8): https://commits.webkit.org/284418@main Reviewed commits have been landed. Closing PR #33937 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
f5c7df8
1c5ecac