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

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: Rebase + Layout Testcase 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..78bcb851428b9577b2a82e9b2d4c325391380b1f 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()))) {
+ if (HTMLSelectElement* select = ownerSelectElement())
+ select->updateListOnRenderer();
esprehn 2014/03/20 17:09:25 This is not the correct place to do this.
spartha 2014/03/21 05:13:26 Since we don't have a renderer associated with thi
+ }
return m_style;
}
@@ -375,4 +380,12 @@ HTMLFormElement* HTMLOptionElement::form() const
return 0;
}
+bool HTMLOptionElement::isDisplayNone() const
+{
+ RenderStyle* style = nonRendererStyle();
+ if (style && style->display() == NONE)
esprehn 2014/03/20 17:09:25 return style && style->display() == NONE;
spartha 2014/03/21 05:13:26 Done.
+ return false;
+ return true;
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698