-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 6d76fb1. rdar://115226509
AX: No accessibility label is exposed for display:contents role="treeitem" elements that have a newline before their child text https://bugs.webkit.org/show_bug.cgi?id=261376 rdar://problem/115226509 Reviewed by Chris Fleizach. This patch fixes two bugs: 1. No accessibility label is exposed for display:contents role="treeitem" elements that have a newline before their child text 2. Some display:contents role="treeitem" expose text for other elements, resulting in that text being doubly-exposed The first was caused by a lack of resilience in AccessibilityNodeObject::firstChild. AccessibilityNodeObject::textUnderElement relies on iterating through its accessible children like so: for (RefPtr child = firstChild(); child; child = child->nextSibling()) { ... compute AX text ... } However, for elements that AXObjectCache::getOrCreate fails to create an object for, we would never iterate because firstChild returned nullptr, thus resulting in no AX text being gathered. AccessibilityNodeObject::firstChild now detects this, and iterates until it finds the first accessible child. The second bug was caused by AccessibilityNodeObject::textUnderElement recursively calling and textUnderElement for an element that was not it's child. With this patch, we detect this and continue the loop when it happens. New testcases added to accessibility/display-contents/tree-and-treeitems.html. * LayoutTests/accessibility/display-contents/tree-and-treeitems-expected.txt: * LayoutTests/accessibility/display-contents/tree-and-treeitems.html: * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::operator<<): * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::firstChild const): (WebCore::AccessibilityNodeObject::textUnderElement const): * Source/WebCore/accessibility/AccessibilityObjectInterface.h: Canonical link: https://commits.webkit.org/267839@main Identifier: 265423.1036@safari-7616-branch
- Loading branch information
Showing
5 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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