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

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

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: esprehn comments and fix layout tests to use testharness.js Created 4 years, 6 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
Index: third_party/WebKit/Source/modules/accessibility/AXObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
index 09e272689e20a0a091b1d4ddf465b1347b8c5ca3..26359cf99942ff77a0cdf4aa7154cf0f4844ac96 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -576,8 +576,11 @@ bool AXObject::computeIsInertOrAriaHidden(IgnoredReasons* ignoredReasons) const
else
ignoredReasons->append(IgnoredReason(AXInert));
} else {
- // TODO(aboxhall): handle inert attribute if it eventuates
- ignoredReasons->append(IgnoredReason(AXInert));
+ const AXObject* inertRootEl = inertRoot();
+ if (inertRootEl == this)
+ ignoredReasons->append(IgnoredReason(AXInert));
+ else
+ ignoredReasons->append(IgnoredReason(AXInertRoot, inertRootEl));
}
}
return true;
@@ -633,6 +636,16 @@ const AXObject* AXObject::ariaHiddenRoot() const
return 0;
}
+const AXObject* AXObject::inertRoot() const
+{
+ for (const AXObject* object = this; object; object = object->parentObject()) {
dmazzoni 2016/06/29 17:00:56 Since "inert" is a property of the DOM, and aria-o
+ if (object->hasAttribute(inertAttr))
+ return object;
+ }
+
+ return 0;
+}
+
bool AXObject::isDescendantOfDisabledNode() const
{
updateCachedAttributeValuesIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698