Index: Source/core/html/HTMLOptionElement.cpp |
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp |
index a02a889367e73b3afbc50809de3ccd44a1c21b21..bddd0e0e142b8fccb468a1663682a1701874c1d8 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) { |
+ HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*this); |
keishi
2014/08/06 03:00:20
I don't think we need to traverse.
Options that ar
spartha
2014/08/06 06:23:02
The spec says "In HTML 4, all OPTGROUP elements mu
spartha
2014/08/06 08:13:31
Avoided calling the Traversal
On 2014/08/06 03:00:
|
+ 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 |