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

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

Issue 2130653002: SELECT element: Introduce light-weight OPTION iterater. (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 66ac70079a4f7e7abd5d27a3cc4243c82bca4bba..d16d9dfe24f399cff7499f2f96d7ddc12ebf4f05 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -887,10 +887,7 @@ void HTMLSelectElement::resetToDefaultSelection(ResetReason reason)
// We can't use HTMLSelectElement::options here because this function is
// called in Node::insertedInto and Node::removedFrom before invalidating
// node collections.
- for (auto& item : listItems()) {
- if (!isHTMLOptionElement(item))
- continue;
- HTMLOptionElement* option = toHTMLOptionElement(item);
+ for (const auto& option : optionList()) {
if (option->selected()) {
if (lastSelectedOption) {
lastSelectedOption->setSelectedState(false);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.h ('k') | third_party/WebKit/Source/core/html/forms/OptionList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698