Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2791943002: Re-land: Initial skeleton of Accessibility Object Model Phase 1 (Closed)
Patch Set: Fix for crash with test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..42f044579f08549e8a4912daae5383f97d395b19 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -29,6 +29,7 @@
#include "modules/accessibility/AXNodeObject.h"
#include "core/InputTypeNames.h"
+#include "core/dom/AccessibleNode.h"
#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/Element.h"
#include "core/dom/NodeTraversal.h"
@@ -618,7 +619,8 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const {
return IgnoredRole;
if (isHTMLIFrameElement(*getNode())) {
- const AtomicString& ariaRole = getAttribute(roleAttr);
+ const AtomicString& ariaRole =
+ getAOMPropertyOrARIAAttribute(AOMStringProperty::kRole);
if (ariaRole == "none" || ariaRole == "presentation")
return IframePresentationalRole;
return IframeRole;
@@ -691,7 +693,8 @@ AccessibilityRole AXNodeObject::determineAccessibilityRole() {
}
AccessibilityRole AXNodeObject::determineAriaRoleAttribute() const {
- const AtomicString& ariaRole = getAttribute(roleAttr);
+ const AtomicString& ariaRole =
+ getAOMPropertyOrARIAAttribute(AOMStringProperty::kRole);
if (ariaRole.isNull() || ariaRole.isEmpty())
return UnknownRole;
@@ -1991,7 +1994,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 =
+ getAOMPropertyOrARIAAttribute(AOMStringProperty::kLabel);
if (!ariaLabel.isEmpty())
return false;
@@ -2925,8 +2929,8 @@ String AXNodeObject::nativeTextAlternative(
nameSources->back().type = nameFrom;
}
if (Element* documentElement = document->documentElement()) {
- const AtomicString& ariaLabel =
- documentElement->getAttribute(aria_labelAttr);
+ const AtomicString& ariaLabel = AccessibleNode::getProperty(
aboxhall 2017/04/03 08:41:55 This looks good, but why not do this everywhere ge
dmazzoni 2017/04/03 15:25:48 It depends on whether we have an AXObject or an El
+ documentElement, AOMStringProperty::kLabel);
if (!ariaLabel.isEmpty()) {
textAlternative = ariaLabel;
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementRareData.cpp ('k') | third_party/WebKit/Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698