Index: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp |
index edfa1c61e7b2bbb641948c0cfd806718ebb33027..2d7c460b48813dcc3c643a80321a6f1a58d06e2d 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp |
@@ -1064,22 +1064,6 @@ int HTMLSelectElement::optionToListIndex(int optionIndex) const |
return -1; |
} |
-int HTMLSelectElement::listToOptionIndex(int listIndex) const |
-{ |
- const ListItems& items = listItems(); |
- if (!optionAtListIndex(listIndex)) |
- return -1; |
- |
- // Actual index of option not counting OPTGROUP entries that may be in list. |
- int optionIndex = 0; |
- for (int i = 0; i < listIndex; ++i) { |
- if (isHTMLOptionElement(*items[i])) |
- ++optionIndex; |
- } |
- |
- return optionIndex; |
-} |
- |
void HTMLSelectElement::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities) |
{ |
// Save the selection so it can be compared to the new selection when |
@@ -1720,14 +1704,13 @@ void HTMLSelectElement::typeAheadFind(KeyboardEvent* event) |
listBoxOnChange(); |
} |
-void HTMLSelectElement::accessKeySetSelectedIndex(int index) |
+void HTMLSelectElement::selectOptionByAccessKey(HTMLOptionElement* option) |
{ |
// First bring into focus the list box. |
if (!focused()) |
accessKeyAction(false); |
- HTMLOptionElement* option = item(index); |
- if (!option) |
+ if (!option || option->ownerSelectElement() != this) |
return; |
EventQueueScope scope; |
// If this index is already selected, unselect. otherwise update the |