Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2147963004: AX: Don't use listIndex in AXListBoxOption class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698