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

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

Issue 1181183004: Recalc list items for <select> before updating style for the select. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Call recalcListItems directly. Created 5 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
« Source/core/dom/Element.cpp ('K') | « 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 40e693be924001375294aac11ae0a0f410e5de77..f73d7202922a81c2a58435b47c91fc66e624ee9f 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -85,6 +85,7 @@ HTMLSelectElement::HTMLSelectElement(Document& document, HTMLFormElement* form)
, m_suggestedIndex(-1)
, m_isAutofilledByPreview(false)
{
+ setHasCustomStyleCallbacks();
}
PassRefPtrWillBeRawPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document)
@@ -1751,6 +1752,14 @@ DEFINE_TRACE(HTMLSelectElement)
HTMLFormControlElementWithState::trace(visitor);
}
+void HTMLSelectElement::willRecalcStyle(StyleRecalcChange change)
+{
+ // TODO(esprehn): recalcListItems will update the selected states of list
ojan 2015/06/19 01:05:02 It's not clear what the TODO here is.
+ // items so we need to do it first so we match the correct style <option>'s.
+ if (m_shouldRecalcListItems)
+ recalcListItems();
+}
+
void HTMLSelectElement::didAddUserAgentShadowRoot(ShadowRoot& root)
{
RefPtrWillBeRawPtr<HTMLContentElement> content = HTMLContentElement::create(document());
« Source/core/dom/Element.cpp ('K') | « Source/core/html/HTMLSelectElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698