Index: third_party/WebKit/Source/core/dom/NodeComputedStyle.h |
diff --git a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h |
index 8ba226ca765bf86c36cae8d95a18a37742c764de..55bff9a4d77e094dc137a3403a5576c7e1835f7d 100644 |
--- a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h |
+++ b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h |
@@ -25,6 +25,7 @@ |
#ifndef NodeComputedStyle_h |
#define NodeComputedStyle_h |
+#include "core/dom/Element.h" |
#include "core/dom/LayoutTreeBuilderTraversal.h" |
#include "core/dom/Node.h" |
#include "core/dom/shadow/InsertionPoint.h" |
@@ -41,12 +42,19 @@ inline const ComputedStyle* Node::computedStyle() const { |
inline ComputedStyle* Node::mutableComputedStyle() const { |
if (LayoutObject* layoutObject = this->layoutObject()) |
return layoutObject->mutableStyle(); |
- // <option> and <optgroup> can be styled even if they don't get layout |
- // objects, so they store their style internally and return it through |
- // nonLayoutObjectComputedStyle(). We check here explicitly to avoid the |
- // virtual call in the common case. |
- if (isHTMLOptGroupElement(*this) || isHTMLOptionElement(this)) |
- return nonLayoutObjectComputedStyle(); |
+ |
+ if (isElementNode()) { |
+ if (ComputedStyle* style = toElement(this)->mutableDisplayContentsStyle()) |
+ return style; |
+ |
+ // <option> and <optgroup> can be styled even if they don't get layout |
+ // objects, so they store their style internally and return it through |
+ // nonLayoutObjectComputedStyle(). We check here explicitly to avoid the |
+ // virtual call in the common case. |
+ if (isHTMLOptGroupElement(*this) || isHTMLOptionElement(this)) |
+ return nonLayoutObjectComputedStyle(); |
rune
2016/11/01 07:12:23
Now we will have two different ways of persisting
emilio
2016/11/01 15:46:31
Yep, this was already in my mind. I'd prefer to do
|
+ } |
+ |
return 0; |
} |