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

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

Issue 2112243004: Ignores ARIA relations (e.g. aria-labelledby) that point to an invisible target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test. Created 4 years, 5 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/aria-relations-should-ignore-hidden-targets.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 176a48c22a4dae8e21ccf8f2e1964df99cea1061..c137527dffc57c7dc3907aa5439008fb602806a1 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -578,8 +578,15 @@ void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObje
AXObjectCacheImpl& cache = axObjectCache();
for (const auto& element : elements) {
- if (AXObject* child = cache.getOrCreate(element))
+ if (AXObject* child = cache.getOrCreate(element)) {
+ // Only aria-labelledby and aria-describedby can target hidden elements.
+ if (child->accessibilityIsIgnored()
+ && attr != aria_labelledbyAttr && attr != aria_labeledbyAttr
+ && attr != aria_describedbyAttr) {
+ continue;
+ }
children.append(child);
+ }
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698