| 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..66ea97bb813a331827d78b6547c9069bcdbc3432 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
|
| @@ -119,9 +119,31 @@ 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 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();
|
| +
|
| + bool foundTextAlternative = false;
|
| + String textAlternative = ariaTextAlternative(recursive, inAriaLabelledByTraversal, visited, nameFrom, relatedObjects, nameSources, &foundTextAlternative);
|
| + if (foundTextAlternative && !nameSources)
|
| + return textAlternative;
|
| +
|
| + nameFrom = AXNameFromContents;
|
| + textAlternative = m_element->displayLabel();
|
| + if (nameSources) {
|
| + nameSources->append(NameSource(foundTextAlternative));
|
| + nameSources->last().type = nameFrom;
|
| + nameSources->last().text = textAlternative;
|
| + foundTextAlternative = true;
|
| + }
|
| +
|
| + return textAlternative;
|
| +
|
| }
|
|
|
| DEFINE_TRACE(AXMenuListOption)
|
|
|