Index: third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp |
index 02f4f527fb31ac57136d673352b67d9c1670e241..0884d6ac4e2f03072d999ad219b4fd933fb1aa40 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp |
@@ -59,16 +59,6 @@ namespace blink { |
using namespace HTMLNames; |
-inline ComputedStyle* getElementStyle(Element& element) { |
- if (element.needsReattachLayoutTree()) { |
- StyleReattachData styleReattachData = |
- element.document().getStyleReattachData(element); |
- if (styleReattachData.computedStyle) |
- return styleReattachData.computedStyle.get(); |
- } |
- return element.mutableComputedStyle(); |
-} |
- |
bool SharedStyleFinder::canShareStyleWithControl(Element& candidate) const { |
if (!isHTMLInputElement(candidate) || !isHTMLInputElement(element())) |
return false; |
@@ -238,15 +228,15 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const { |
if (element() == candidate) |
return false; |
Element* parent = candidate.parentOrShadowHostElement(); |
- const ComputedStyle* style = getElementStyle(candidate); |
+ const ComputedStyle* style = candidate.computedStyle(); |
if (!style) |
return false; |
if (!style->isSharable()) |
return false; |
if (!parent) |
return false; |
- if (getElementStyle(*element().parentOrShadowHostElement()) != |
- getElementStyle(*parent)) |
+ if (element().parentOrShadowHostElement()->computedStyle() != |
+ parent->computedStyle()) |
return false; |
if (candidate.tagQName() != element().tagQName()) |
return false; |
@@ -257,6 +247,8 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const { |
if (candidate.isSVGElement() && |
toSVGElement(candidate).animatedSMILStyleProperties()) |
return false; |
+ if (style->hasPseudoElementStyle()) |
+ return false; |
if (candidate.isLink() != element().isLink()) |
return false; |
if (candidate.shadowPseudoId() != element().shadowPseudoId()) |
@@ -417,7 +409,7 @@ ComputedStyle* SharedStyleFinder::findSharedStyle() { |
return nullptr; |
} |
- return getElementStyle(*shareElement); |
+ return shareElement->mutableComputedStyle(); |
} |
} // namespace blink |