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 b111fbf8f42f0da51608f3f81c645140a1b0c201..5cb090dc6935b4f3a5ee6ba2c96a765fc17c6200 100644 |
--- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp |
+++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp |
@@ -108,7 +108,7 @@ bool AXListBoxOption::isSelectedOptionActive() const |
if (!listBoxParentNode) |
return false; |
- return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionIndex(); |
+ return listBoxParentNode->activeSelectionEnd() == getNode(); |
} |
bool AXListBoxOption::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons) const |
@@ -176,9 +176,7 @@ void AXListBoxOption::setSelected(bool selected) |
if ((isOptionSelected && selected) || (!isOptionSelected && !selected)) |
return; |
- // Convert from the entire list index to the option index. |
- int optionIndex = selectElement->listToOptionIndex(listBoxOptionIndex()); |
- selectElement->accessKeySetSelectedIndex(optionIndex); |
+ selectElement->selectOptionByAccessKey(toHTMLOptionElement(getNode())); |
} |
HTMLSelectElement* AXListBoxOption::listBoxOptionParentNode() const |
@@ -192,20 +190,4 @@ HTMLSelectElement* AXListBoxOption::listBoxOptionParentNode() const |
return 0; |
} |
-int AXListBoxOption::listBoxOptionIndex() const |
-{ |
- HTMLSelectElement* selectElement = listBoxOptionParentNode(); |
- if (!selectElement) |
- return -1; |
- |
- const HeapVector<Member<HTMLElement>>& listItems = selectElement->listItems(); |
- unsigned length = listItems.size(); |
- for (unsigned i = 0; i < length; i++) { |
- if (listItems[i] == getNode()) |
- return i; |
- } |
- |
- return -1; |
-} |
- |
} // namespace blink |