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

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

Issue 189543012: Update <select> when any of its <option> children has "display: none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch without setTimeout Created 6 years, 9 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: Source/core/html/HTMLOptionElement.cpp
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index c0b02f12ef71b46fdeb0ba02b6d1e17bed4813ba..05d36a35f80c77e1d74f69dc1adbf598b5ee5e53 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -303,7 +303,12 @@ RenderStyle* HTMLOptionElement::nonRendererStyle() const
PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
{
+ RefPtr<RenderStyle> oldStyle = m_style;
updateNonRenderStyle();
+ if ((m_style->display() == NONE || (!oldStyle || oldStyle->display() == NONE)) && (!oldStyle || (m_style->display() != oldStyle->display()))) {
esprehn 2014/03/21 20:43:39 This can be much simpler, just do: bool wasDispla
spartha 2014/03/21 21:29:03 Done.
+ if (HTMLSelectElement* select = ownerSelectElement())
+ select->updateListOnRenderer();
+ }
return m_style;
}
@@ -375,4 +380,10 @@ HTMLFormElement* HTMLOptionElement::form() const
return 0;
}
+bool HTMLOptionElement::isDisplayNone() const
+{
+ RenderStyle* style = nonRendererStyle();
+ return style && style->display() == NONE;
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698