Index: third_party/WebKit/Source/core/dom/Element.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp |
index 71773b8257082eb9f7765e35561721991944fdc1..1076c4d49b475122b794af88f1c25977bf6b189f 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -1556,7 +1556,7 @@ void Element::attachLayoutTree(const AttachContext& context) |
// need to clear any state that's been added since then. |
if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { |
ElementRareData* data = elementRareData(); |
- data->clearComputedStyle(); |
+ data->clearComputedStyleIfNoLayoutObject(); |
} |
if (!isSlotOrActiveInsertionPoint()) |
@@ -1602,7 +1602,7 @@ void Element::detachLayoutTree(const AttachContext& context) |
// attachLayoutTree() will clear the computed style for us when inside recalcStyle. |
if (!document().inStyleRecalc()) |
- data->clearComputedStyle(); |
+ data->clearComputedStyleIfNoLayoutObject(); |
if (ElementAnimations* elementAnimations = data->elementAnimations()) { |
if (context.performingReattach) { |
@@ -1732,7 +1732,7 @@ void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling) |
if (hasRareData()) { |
ElementRareData* data = elementRareData(); |
if (change != IndependentInherit) |
- data->clearComputedStyle(); |
+ data->clearComputedStyleIfNoLayoutObject(); |
if (change >= IndependentInherit) { |
if (ElementAnimations* elementAnimations = data->elementAnimations()) |