Index: third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
index 3f85a53534bdc75a37565030ea4201e165bcdc38..77af524708ff1d5fb6bc3500898b73c3539035f4 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
@@ -183,13 +183,8 @@ int HTMLOptionElement::index() const |
return 0; |
int optionIndex = 0; |
- |
- const HeapVector<Member<HTMLElement>>& items = selectElement->listItems(); |
- size_t length = items.size(); |
- for (size_t i = 0; i < length; ++i) { |
- if (!isHTMLOptionElement(*items[i])) |
- continue; |
- if (items[i].get() == this) |
+ for (const auto& option : selectElement->optionList()) { |
+ if (option == this) |
return optionIndex; |
++optionIndex; |
} |