| 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;
|
| + 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();
|
| }
|
|
|
|
|