| 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 2e9b20e6a8035cd0d300595e0428bb40c482abc3..819ea4f1a92815f54bb93599698a21e4b7587c8e 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| @@ -536,10 +536,14 @@ bool AXObject::computeIsInertOrAriaHidden(
|
| ignoredReasons->push_back(
|
| IgnoredReason(AXActiveModalDialog, dialogObject));
|
| else
|
| - ignoredReasons->push_back(IgnoredReason(AXInert));
|
| + ignoredReasons->push_back(IgnoredReason(AXInertElement));
|
| } else {
|
| - // TODO(aboxhall): handle inert attribute if it eventuates
|
| - ignoredReasons->push_back(IgnoredReason(AXInert));
|
| + const AXObject* inertRoot = this->inertRoot();
|
| + if (inertRoot == this) {
|
| + ignoredReasons->push_back(IgnoredReason(AXInertElement));
|
| + } else {
|
| + ignoredReasons->push_back(IgnoredReason(AXInertSubtree, inertRoot));
|
| + }
|
| }
|
| }
|
| return true;
|
| @@ -556,10 +560,12 @@ bool AXObject::computeIsInertOrAriaHidden(
|
| const AXObject* hiddenRoot = ariaHiddenRoot();
|
| if (hiddenRoot) {
|
| if (ignoredReasons) {
|
| - if (hiddenRoot == this)
|
| - ignoredReasons->push_back(IgnoredReason(AXAriaHidden));
|
| - else
|
| - ignoredReasons->push_back(IgnoredReason(AXAriaHiddenRoot, hiddenRoot));
|
| + if (hiddenRoot == this) {
|
| + ignoredReasons->push_back(IgnoredReason(AXAriaHiddenElement));
|
| + } else {
|
| + ignoredReasons->push_back(
|
| + IgnoredReason(AXAriaHiddenSubtree, hiddenRoot));
|
| + }
|
| }
|
| return true;
|
| }
|
| @@ -592,6 +598,24 @@ const AXObject* AXObject::ariaHiddenRoot() const {
|
| return 0;
|
| }
|
|
|
| +const AXObject* AXObject::inertRoot() const {
|
| + const AXObject* object = this;
|
| + if (!RuntimeEnabledFeatures::inertAttributeEnabled())
|
| + return nullptr;
|
| +
|
| + while (object && !object->isAXNodeObject())
|
| + object = object->parentObject();
|
| + for (Node* node = object->getNode(); node;
|
| + node = FlatTreeTraversal::parentElement(*node)) {
|
| + if (!node->isElementNode())
|
| + continue;
|
| + if (toElement(node)->hasAttribute(inertAttr))
|
| + return axObjectCache().getOrCreate(node);
|
| + }
|
| +
|
| + return nullptr;
|
| +}
|
| +
|
| bool AXObject::isDescendantOfDisabledNode() const {
|
| updateCachedAttributeValuesIfNeeded();
|
| return m_cachedIsDescendantOfDisabledNode;
|
|
|