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

Unified Diff: Source/core/rendering/RenderMenuList.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: 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
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMenuList.cpp
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index 57ac3b845c3a872b4546cb08d9fab7f77e7551d6..36c686863a272208f8c3b4771df2f0498673a17c 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -502,8 +502,18 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
getItemBackgroundColor(listIndex, itemBackgroundColor, itemHasCustomBackgroundColor);
RenderStyle* style = element->renderStyle() ? element->renderStyle() : element->computedStyle();
+ bool displayNone = style && style->display() == NONE;
keishi 2014/08/01 02:01:11 This nested display:none case is already handled c
spartha 2014/08/01 09:29:16 Thanks for the review! Even I felt that it would b
+ if (!displayNone) {
+ HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*element);
+ ASSERT(parent);
+ if (parent->hasTagName(optgroupTag)) {
+ RenderStyle* parentStyle = parent->renderStyle() ? parent->renderStyle() : parent->computedStyle();
+ if (parentStyle && parentStyle->display() == NONE)
+ displayNone = true;
+ }
+ }
return style ? PopupMenuStyle(resolveColor(style, CSSPropertyColor), itemBackgroundColor, style->font(), style->visibility() == VISIBLE,
- style->display() == NONE, style->textIndent(), style->direction(), isOverride(style->unicodeBidi()),
+ displayNone, style->textIndent(), style->direction(), isOverride(style->unicodeBidi()),
itemHasCustomBackgroundColor ? PopupMenuStyle::CustomBackgroundColor : PopupMenuStyle::DefaultBackgroundColor) : menuStyle();
}
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698