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

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: Update inspector-protocol test expectations 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..9029f2bcb5837abe350afac8259b9569cf49aaf0 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(false, aria_labelAttr));
+ nameSources->last().type = nameFrom;
+ nameSources->last().text = ariaLabel;
+ }
return ariaLabel;
aboxhall 2015/11/16 22:03:28 Note: we shouldn't return immediately if nameSourc
dmazzoni 2015/11/17 17:04:29 Got it. I refactored this out into a new helper,
aboxhall 2015/11/17 20:06:21 Nice.
+ }
- if (isHTMLOptionElement(node()))
- return toHTMLOptionElement(node())->displayLabel();
+ if (!isHTMLOptionElement(node()))
+ return String();
+
+ nameFrom = AXNameFromContents;
+ if (nameSources) {
+ nameSources->append(NameSource(false));
aboxhall 2015/11/16 22:03:28 Then, this needs to be dependent on whether we fou
dmazzoni 2015/11/17 17:04:29 Done.
+ 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