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

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: Update Test Expectations 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
« no previous file with comments | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptionElement.cpp
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index abeb8577912a63d3971ce0dbd0ded390cc7e47b7..278fa753269893e640e06135f0cc445d069fb8f7 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,16 @@ HTMLFormElement* HTMLOptionElement::form() const
return 0;
}
+bool HTMLOptionElement::isDisplayNone() const
+{
+ ContainerNode* parent = parentNode();
+ // Check for parent optgroup having display NONE
+ if (parent && isHTMLOptGroupElement(*parent)) {
+ if (toHTMLOptGroupElement(*parent).isDisplayNone())
+ return true;
+ }
+ RenderStyle* style = nonRendererStyle();
+ return style && style->display() == NONE;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698