Chromium Code Reviews| Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
| index e27a9b21a417919596fb3f24fb1126e28dc7d775..299fc0fa9e2defdb8f0e547cbf2d831b1e1bc33f 100644 |
| --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
| +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
| @@ -618,7 +618,8 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const { |
| return IgnoredRole; |
| if (isHTMLIFrameElement(*getNode())) { |
| - const AtomicString& ariaRole = getAttribute(roleAttr); |
| + const AtomicString& ariaRole = |
| + getAriaAttributeOrAOMProperty(AOMStringProperty::Role); |
|
esprehn
2017/03/22 03:40:32
I'm skeptical of having a separate enum for every
dmazzoni
2017/03/23 03:36:41
We use this pattern elsewhere in accessibility cod
|
| if (ariaRole == "none" || ariaRole == "presentation") |
| return IframePresentationalRole; |
| return IframeRole; |
| @@ -691,7 +692,8 @@ AccessibilityRole AXNodeObject::determineAccessibilityRole() { |
| } |
| AccessibilityRole AXNodeObject::determineAriaRoleAttribute() const { |
| - const AtomicString& ariaRole = getAttribute(roleAttr); |
| + const AtomicString& ariaRole = |
| + getAriaAttributeOrAOMProperty(AOMStringProperty::Role); |
| if (ariaRole.isNull() || ariaRole.isEmpty()) |
| return UnknownRole; |
| @@ -1991,7 +1993,8 @@ bool AXNodeObject::nameFromLabelElement() const { |
| return false; |
| // Step 2C from: http://www.w3.org/TR/accname-aam-1.1 |
| - const AtomicString& ariaLabel = getAttribute(aria_labelAttr); |
| + const AtomicString& ariaLabel = |
| + getAriaAttributeOrAOMProperty(AOMStringProperty::Label); |
| if (!ariaLabel.isEmpty()) |
| return false; |
| @@ -2925,8 +2928,10 @@ String AXNodeObject::nativeTextAlternative( |
| nameSources->back().type = nameFrom; |
| } |
| if (Element* documentElement = document->documentElement()) { |
| + AXObject* axDocument = axObjectCache().getOrCreate(documentElement); |
| + DCHECK(axDocument); |
| const AtomicString& ariaLabel = |
| - documentElement->getAttribute(aria_labelAttr); |
| + axDocument->getAriaAttributeOrAOMProperty(AOMStringProperty::Label); |
| if (!ariaLabel.isEmpty()) { |
| textAlternative = ariaLabel; |