Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 1917943002: Accessible name calc should allow aria-labelledby to reference aria-hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 0e68691113381ecaef9955e8a2d8d8af865009b7..e27b54f495c82e0c75f2e48d521be16364cd9e35 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1649,8 +1649,12 @@ String AXNodeObject::textFromDescendants(AXObjectSet& visited, bool recursive) c
children.append(ownedChild);
for (AXObject* child : children) {
- // Skip hidden children
- if (child->isInertOrAriaHidden())
+ // Don't recurse into children that are explicitly marked as aria-hidden.
+ // Note that we don't call isInertOrAriaHidden because that would return true
+ // if any ancestor is hidden, but we need to be able to compute the accessible
+ // name of object inside hidden subtrees (for example, if aria-labelledby points
+ // to an object that's hidden).
+ if (equalIgnoringCase(child->getAttribute(aria_hiddenAttr), "true"))
continue;
// If we're going between two layoutObjects that are in separate LayoutBoxes, add
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698