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

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

Issue 1076453004: Show reasons why nodes are ignored in accessibility sidebar (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a catch-all return to ignoredReasonName Created 5 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 | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index d0b033a36e26e356bb0b60c266aab2918a3498f5..f744844570e95d69347c7e780430bfd00aff041c 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -167,15 +167,33 @@ bool AXNodeObject::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons)
#endif
// If this element is within a parent that cannot have children, it should not be exposed.
- if (isDescendantOfLeafNode())
+ if (isDescendantOfLeafNode()) {
+ if (ignoredReasons)
+ ignoredReasons->append(IgnoredReason(AXAncestorIsLeafNode, leafNodeAncestor()));
return true;
+ }
// Ignore labels that are already referenced by a control's title UI element.
AXObject* controlObject = correspondingControlForLabelElement();
- if (controlObject && !controlObject->deprecatedExposesTitleUIElement() && controlObject->isCheckboxOrRadio())
+ if (controlObject && !controlObject->deprecatedExposesTitleUIElement() && controlObject->isCheckboxOrRadio()) {
+ if (ignoredReasons) {
+ HTMLLabelElement* label = labelElementContainer();
+ if (label && !label->isSameNode(node())) {
+ AXObject* labelAXObject = axObjectCache()->getOrCreate(label);
+ ignoredReasons->append(IgnoredReason(AXLabelContainer, labelAXObject));
+ }
+
+ ignoredReasons->append(IgnoredReason(AXLabelFor, controlObject));
+ }
return true;
+ }
- return m_role == UnknownRole;
+ if (m_role == UnknownRole) {
+ if (ignoredReasons)
+ ignoredReasons->append(IgnoredReason(AXUninteresting));
+ return true;
+ }
+ return false;
}
static bool isListElement(Node* node)
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698