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

Unified Diff: Source/core/html/HTMLOptGroupElement.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/HTMLOptGroupElement.h ('k') | Source/core/html/HTMLOptionElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptGroupElement.cpp
diff --git a/Source/core/html/HTMLOptGroupElement.cpp b/Source/core/html/HTMLOptGroupElement.cpp
index d9f835b0faf0c1bed924df7183c59ed7dc6dc81b..8725226c8a996c4f7b75e7df904d4e99b0279fe3 100644
--- a/Source/core/html/HTMLOptGroupElement.cpp
+++ b/Source/core/html/HTMLOptGroupElement.cpp
@@ -96,7 +96,12 @@ void HTMLOptGroupElement::detach(const AttachContext& context)
void HTMLOptGroupElement::updateNonRenderStyle()
{
+ bool oldDisplayNoneStatus = isDisplayNone();
m_style = originalStyleForRenderer();
+ if (oldDisplayNoneStatus != isDisplayNone()) {
+ if (HTMLSelectElement* select = ownerSelectElement())
+ select->updateListOnRenderer();
+ }
}
RenderStyle* HTMLOptGroupElement::nonRendererStyle() const
@@ -135,4 +140,10 @@ void HTMLOptGroupElement::accessKeyAction(bool)
select->accessKeyAction(false);
}
+bool HTMLOptGroupElement::isDisplayNone() const
+{
+ RenderStyle* style = nonRendererStyle();
+ return style && style->display() == NONE;
+}
+
} // namespace
« no previous file with comments | « Source/core/html/HTMLOptGroupElement.h ('k') | Source/core/html/HTMLOptionElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698