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

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

Issue 2109993003: Remove redundant calls to HTMLSelectElement::setRecalcListItems(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 3117a85f4d7e33e04735d4864d8f66dbb1ca27ae..2365ee4538f8de972f6c2a45b33081d2b212816f 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -420,15 +420,6 @@ HTMLOptionsCollection* HTMLSelectElement::options()
return ensureCachedCollection<HTMLOptionsCollection>(SelectOptions);
}
-void HTMLSelectElement::childrenChanged(const ChildrenChange& change)
-{
- setRecalcListItems();
- setNeedsValidityCheck();
- m_lastOnChangeSelection.clear();
-
- HTMLFormControlElementWithState::childrenChanged(change);
-}
-
void HTMLSelectElement::optionElementChildrenChanged(const HTMLOptionElement& option)
{
setNeedsValidityCheck();
@@ -985,6 +976,8 @@ void HTMLSelectElement::optionInserted(HTMLOptionElement& option, bool optionIsS
if (!m_lastOnChangeOption)
resetToDefaultSelection();
}
+ setNeedsValidityCheck();
+ m_lastOnChangeSelection.clear();
}
void HTMLSelectElement::optionRemoved(const HTMLOptionElement& option)
@@ -1004,6 +997,21 @@ void HTMLSelectElement::optionRemoved(const HTMLOptionElement& option)
m_activeSelectionEnd.clear();
if (option.selected())
setAutofilled(false);
+ setNeedsValidityCheck();
+ m_lastOnChangeSelection.clear();
+}
+
+void HTMLSelectElement::optGroupInsertedOrRemoved(const HTMLOptGroupElement&)
+{
+ setRecalcListItems();
+ setNeedsValidityCheck();
+ m_lastOnChangeSelection.clear();
+}
+
+void HTMLSelectElement::hrInsertedOrRemoved(const HTMLHRElement&)
+{
+ setRecalcListItems();
+ m_lastOnChangeSelection.clear();
}
void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)

Powered by Google App Engine
This is Rietveld 408576698