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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXListBoxOption.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/AXListBoxOption.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
index 89988c4eb98e1836cd9cc7186f4f25c0786dd7cc..776684d9e29c5ee007eefab314467a6028d19369 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
@@ -138,19 +138,33 @@ bool AXListBoxOption::canSetSelectedAttribute() const
return true;
}
-String AXListBoxOption::stringValue() const
+String AXListBoxOption::textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects, NameSources* nameSources) const
{
if (!node())
return String();
const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
- if (!ariaLabel.isNull())
+ if (!ariaLabel.isEmpty()) {
+ nameFrom = AXNameFromAttribute;
+ if (nameSources) {
+ nameSources->append(NameSource(true, aria_labelAttr));
aboxhall 2015/11/13 23:13:49 Why true?
dmazzoni 2015/11/16 18:52:04 Oh, good catch! I misinterpreted what that first a
+ nameSources->last().type = nameFrom;
+ nameSources->last().text = ariaLabel;
+ }
return ariaLabel;
+ }
- if (isHTMLOptionElement(node()))
- return toHTMLOptionElement(node())->displayLabel();
+ if (!isHTMLOptionElement(node()))
+ return String();
+
+ nameFrom = AXNameFromContents;
+ if (nameSources) {
+ nameSources->append(NameSource(true));
+ nameSources->last().type = nameFrom;
+ nameSources->last().text = toHTMLOptionElement(node())->displayLabel();
+ }
- return String();
+ return toHTMLOptionElement(node())->displayLabel();
}
void AXListBoxOption::setSelected(bool selected)

Powered by Google App Engine
This is Rietveld 408576698