Chromium Code Reviews| 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(); |