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

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

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeVox and Automation API tests Created 5 years, 1 month 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/AXMenuListOption.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
index cf362a18ea410f477e09df6fe3612e0af72b8dab..e012f2ac84766782ea881130203496e7391ddc70 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
@@ -119,9 +119,30 @@ LayoutRect AXMenuListOption::elementRect() const
return grandparent->elementRect();
}
-String AXMenuListOption::stringValue() const
+String AXMenuListOption::textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects, NameSources* nameSources) const
{
- return m_element ? m_element->displayLabel() : String();
+ if (!m_element)
+ return String();
+
+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
+ if (!ariaLabel.isEmpty()) {
+ nameFrom = AXNameFromAttribute;
+ if (nameSources) {
+ nameSources->append(NameSource(true, aria_labelAttr));
+ nameSources->last().type = nameFrom;
+ nameSources->last().text = ariaLabel;
+ }
+ return ariaLabel;
+ }
+
+ nameFrom = AXNameFromContents;
+ if (nameSources) {
+ nameSources->append(NameSource(true));
+ nameSources->last().type = nameFrom;
+ nameSources->last().text = m_element->displayLabel();
+ }
+
+ return m_element->displayLabel();
}
DEFINE_TRACE(AXMenuListOption)

Powered by Google App Engine
This is Rietveld 408576698