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

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

Issue 791533004: Don't updateRenderTree in the middle of a DOM insertion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years 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
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index fca149034297727549b4609a6e9ea980fb9652d1..a344449b509b81583b5927749d6e275f7ec0a88d 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -84,7 +84,6 @@ HTMLSelectElement::HTMLSelectElement(Document& document, HTMLFormElement* form)
, m_shouldRecalcListItems(false)
, m_suggestedIndex(-1)
, m_isAutofilledByPreview(false)
- , m_scrollToSelectionLater(false)
{
}
@@ -419,11 +418,6 @@ void HTMLSelectElement::childrenChanged(const ChildrenChange& change)
m_lastOnChangeSelection.clear();
HTMLFormControlElementWithState::childrenChanged(change);
-
- if (m_scrollToSelectionLater) {
- m_scrollToSelectionLater = false;
- scrollToSelection();
- }
}
void HTMLSelectElement::optionElementChildrenChanged()
@@ -928,7 +922,7 @@ void HTMLSelectElement::optionInserted(const HTMLOptionElement& option, bool opt
{
ASSERT(option.ownerSelectElement() == this);
if (optionIsSelected)
- selectOption(option.index(), DelayScrollToSelection);
+ selectOption(option.index());
}
void HTMLSelectElement::optionRemoved(const HTMLOptionElement& option)
@@ -973,11 +967,7 @@ void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)
if (RenderObject* renderer = this->renderer())
renderer->updateFromElement();
- if (flags & DelayScrollToSelection)
- m_scrollToSelectionLater = true;
- else
- scrollToSelection();
-
+ scrollToSelection();
setNeedsValidityCheck();
if (usesMenuList()) {
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698