Chromium Code Reviews| 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) |