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

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: Created 6 years, 4 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..c7b931649f6f9763531d752b1c673f07c2f71829 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -397,4 +397,18 @@ bool HTMLOptionElement::spatialNavigationFocused() const
return select->spatialNavigationFocusedOption() == this;
}
+bool HTMLOptionElement::isDisplayNone()
+{
+ RenderStyle* style = renderStyle() ? renderStyle() : computedStyle();
+ if (style && style->display() != NONE) {
+ Element* parent = parentElement();
+ ASSERT(parent);
+ if (isHTMLOptGroupElement(*parent)) {
+ RenderStyle* parentStyle = parent->renderStyle() ? parent->renderStyle() : parent->computedStyle();
+ return !parentStyle || parentStyle->display() == NONE;
+ }
+ }
+ return !style || style->display() == NONE;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698