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

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

Issue 415343003: Option Groups with display: none should not show the children option elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding changes to ExternalPopupMenu Created 6 years, 5 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 a02a889367e73b3afbc50809de3ccd44a1c21b21..d58b7a3bb95e55259dcc8ffebde2e38a130d9d21 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -286,6 +286,15 @@ void HTMLOptionElement::setLabel(const AtomicString& label)
void HTMLOptionElement::updateNonRenderStyle()
{
m_style = originalStyleForRenderer();
+ if (m_style->display() != NONE) {
+ HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*this);
+ ASSERT(parent);
+ if (parent->hasTagName(optgroupTag)) {
+ RenderStyle* parentStyle = parent->renderStyle() ? parent->renderStyle() : parent->computedStyle();
+ if (parentStyle && parentStyle->display() == NONE)
+ m_style->setDisplay(NONE);
keishi 2014/08/04 03:04:03 I don't think we should be changing the style of t
spartha 2014/08/04 15:59:02 Done.
+ }
+ }
if (HTMLSelectElement* select = ownerSelectElement())
select->updateListOnRenderer();
}
« no previous file with comments | « LayoutTests/fast/forms/select/popup-with-display-none-optgroup-expected.txt ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698