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

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

Issue 1160793007: Include aria-label in acc name calculation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missing y Created 5 years, 6 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
« no previous file with comments | « LayoutTests/accessibility/name-calc-aria-label.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index 2c79418780600d03ca686cadf8e37ec36e2a7183..13a1092306aa1ebaee62fe9f6f5e9d0c8c9fbdce 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -1841,6 +1841,16 @@ String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver
return accumulatedText.toString();
}
+ // Step 2C from: http://www.w3.org/TR/accname-aam-1.1
+ if (hasAttribute(aria_labelAttr)) {
+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
+ if (!ariaLabel.isEmpty()) {
+ if (nameFrom)
+ *nameFrom = AXNameFromAttribute;
+ return ariaLabel;
+ }
+ }
+
// Step 2F / 2G from: http://www.w3.org/TR/accname-aam-1.1
if (recursive || nameFromContents()) {
if (nameFrom)
« no previous file with comments | « LayoutTests/accessibility/name-calc-aria-label.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698