| 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 3e18e556d466beaf250314eaee1346ca0c2f1955..4a20d1a95c5bb6829f76c6f17284d89e2aebe668 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| @@ -389,6 +389,39 @@ const AtomicString& AXObject::getAOMPropertyOrARIAAttribute(
|
| return AccessibleNode::getProperty(toElement(node), property);
|
| }
|
|
|
| +bool AXObject::getAOMPropertyOrARIAAttribute(AOMBooleanProperty property,
|
| + bool& result) const {
|
| + Node* node = this->getNode();
|
| + if (!node || !node->isElementNode())
|
| + return false;
|
| +
|
| + bool isNull = true;
|
| + result = AccessibleNode::getProperty(toElement(node), property, isNull);
|
| + return !isNull;
|
| +}
|
| +
|
| +bool AXObject::hasAOMPropertyOrARIAAttribute(
|
| + AOMBooleanProperty property) const {
|
| + bool dummyResult;
|
| + return getAOMPropertyOrARIAAttribute(property, dummyResult);
|
| +}
|
| +
|
| +bool AXObject::AOMPropertyOrARIAAttributeIsTrue(
|
| + AOMBooleanProperty property) const {
|
| + bool result;
|
| + if (getAOMPropertyOrARIAAttribute(property, result))
|
| + return result;
|
| + return false;
|
| +}
|
| +
|
| +bool AXObject::AOMPropertyOrARIAAttributeIsFalse(
|
| + AOMBooleanProperty property) const {
|
| + bool result;
|
| + if (getAOMPropertyOrARIAAttribute(property, result))
|
| + return !result;
|
| + return false;
|
| +}
|
| +
|
| bool AXObject::isARIATextControl() const {
|
| return ariaRoleAttribute() == TextFieldRole ||
|
| ariaRoleAttribute() == SearchBoxRole ||
|
| @@ -596,7 +629,7 @@ AXObject* AXObject::leafNodeAncestor() const {
|
|
|
| const AXObject* AXObject::ariaHiddenRoot() const {
|
| for (const AXObject* object = this; object; object = object->parentObject()) {
|
| - if (equalIgnoringASCIICase(object->getAttribute(aria_hiddenAttr), "true"))
|
| + if (object->AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kHidden))
|
| return object;
|
| }
|
|
|
| @@ -609,16 +642,17 @@ bool AXObject::isDescendantOfDisabledNode() const {
|
| }
|
|
|
| const AXObject* AXObject::disabledAncestor() const {
|
| - const AtomicString& disabled = getAttribute(aria_disabledAttr);
|
| - if (equalIgnoringASCIICase(disabled, "true"))
|
| - return this;
|
| - if (equalIgnoringASCIICase(disabled, "false"))
|
| - return 0;
|
| + bool disabled = false;
|
| + if (getAOMPropertyOrARIAAttribute(AOMBooleanProperty::kDisabled, disabled)) {
|
| + if (disabled)
|
| + return this;
|
| + return nullptr;
|
| + }
|
|
|
| if (AXObject* parent = parentObject())
|
| return parent->disabledAncestor();
|
|
|
| - return 0;
|
| + return nullptr;
|
| }
|
|
|
| bool AXObject::lastKnownIsIgnoredValue() {
|
| @@ -723,7 +757,7 @@ String AXObject::recursiveTextAlternative(const AXObject& axObj,
|
| }
|
|
|
| bool AXObject::isHiddenForTextAlternativeCalculation() const {
|
| - if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), "false"))
|
| + if (AOMPropertyOrARIAAttributeIsFalse(AOMBooleanProperty::kHidden))
|
| return false;
|
|
|
| if (getLayoutObject())
|
| @@ -982,7 +1016,7 @@ bool AXObject::isMultiline() const {
|
| if (!isNativeTextControl() && !isNonNativeTextControl())
|
| return false;
|
|
|
| - return equalIgnoringASCIICase(getAttribute(aria_multilineAttr), "true");
|
| + return AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kMultiline);
|
| }
|
|
|
| bool AXObject::ariaPressedIsPresent() const {
|
|
|