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..924fe9ba96da16fd1a46bc2ab2375f6605356b18 100644 |
--- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp |
+++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp |
@@ -138,19 +138,30 @@ 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 nameSources is non-null, relatedObjects is used in filling it in, so it must be non-null as well. |
+ if (nameSources) |
+ ASSERT(relatedObjects); |
+ |
if (!node()) |
return String(); |
- const AtomicString& ariaLabel = getAttribute(aria_labelAttr); |
- if (!ariaLabel.isNull()) |
- return ariaLabel; |
- |
- if (isHTMLOptionElement(node())) |
- return toHTMLOptionElement(node())->displayLabel(); |
+ bool foundTextAlternative = false; |
+ String textAlternative = ariaTextAlternative(recursive, inAriaLabelledByTraversal, visited, nameFrom, relatedObjects, nameSources, &foundTextAlternative); |
+ if (foundTextAlternative && !nameSources) |
+ return textAlternative; |
+ |
+ nameFrom = AXNameFromContents; |
+ textAlternative = toHTMLOptionElement(node())->displayLabel(); |
+ if (nameSources) { |
+ nameSources->append(NameSource(foundTextAlternative)); |
+ nameSources->last().type = nameFrom; |
+ nameSources->last().text = textAlternative; |
+ foundTextAlternative = true; |
+ } |
- return String(); |
+ return textAlternative; |
} |
void AXListBoxOption::setSelected(bool selected) |