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

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: Created 6 years, 8 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 abeb8577912a63d3971ce0dbd0ded390cc7e47b7..356721ca07ff79f2efaca552b30847983c65abe4 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -282,7 +282,12 @@ void HTMLOptionElement::setLabel(const AtomicString& label)
void HTMLOptionElement::updateNonRenderStyle()
{
+ bool oldDisplayNoneStatus = isDisplayNone();
m_style = originalStyleForRenderer();
+ if (oldDisplayNoneStatus != isDisplayNone()) {
+ if (HTMLSelectElement* select = ownerSelectElement())
+ select->updateListOnRenderer();
+ }
}
RenderStyle* HTMLOptionElement::nonRendererStyle() const
@@ -364,4 +369,10 @@ HTMLFormElement* HTMLOptionElement::form() const
return 0;
}
+bool HTMLOptionElement::isDisplayNone() const
+{
+ RenderStyle* style = nonRendererStyle();
+ return style && style->display() == NONE;
keishi 2014/04/11 15:07:09 We should check parent optgroup.isDisplayNone
spartha 2014/04/12 18:53:22 Done.
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698