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 36bad05fdae17eb1258e795cf047b3e1843b27bf..9b56641d1726c40d78a3b333f274bac67e2550eb 100644 |
| --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| @@ -30,6 +30,7 @@ |
| #include "SkMatrix44.h" |
| #include "core/css/resolver/StyleResolver.h" |
| +#include "core/dom/AccessibleNode.h" |
| #include "core/dom/DocumentUserGestureToken.h" |
| #include "core/editing/EditingUtilities.h" |
| #include "core/editing/VisibleUnits.h" |
| @@ -378,6 +379,15 @@ bool AXObject::isDetached() const { |
| return !m_axObjectCache; |
| } |
| +const AtomicString& AXObject::getAOMPropertyOrARIAAttribute( |
|
aboxhall
2017/03/23 04:34:23
Does this method name still need to refer to ARIA
dmazzoni
2017/03/23 17:06:48
I prefer it during our transition period, so anyon
|
| + AOMStringProperty property) const { |
| + Node* node = this->getNode(); |
| + if (!node || !node->isElementNode()) |
| + return nullAtom; |
| + |
| + return AccessibleNode::getProperty(toElement(node), property); |
| +} |
| + |
| bool AXObject::isARIATextControl() const { |
| return ariaRoleAttribute() == TextFieldRole || |
| ariaRoleAttribute() == SearchBoxRole || |
| @@ -803,7 +813,8 @@ String AXObject::ariaTextAlternative(bool recursive, |
| nameSources->push_back(NameSource(*foundTextAlternative, aria_labelAttr)); |
| nameSources->back().type = nameFrom; |
| } |
| - const AtomicString& ariaLabel = getAttribute(aria_labelAttr); |
| + const AtomicString& ariaLabel = |
| + getAOMPropertyOrARIAAttribute(AOMStringProperty::kLabel); |
| if (!ariaLabel.isEmpty()) { |
| textAlternative = ariaLabel; |