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

Unified Diff: third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp

Issue 2729453002: Revert of Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6c0529d8398a6af248d1e0b841d7f70320b7fbf0 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 @@
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,21 +228,21 @@
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;
if (candidate.inlineStyle())
return false;
- if (candidate.needsStyleRecalc() && !candidate.needsReattachLayoutTree())
+ if (candidate.needsStyleRecalc())
return false;
if (candidate.isSVGElement() &&
toSVGElement(candidate).animatedSMILStyleProperties())
@@ -417,7 +407,7 @@
return nullptr;
}
- return getElementStyle(*shareElement);
+ return shareElement->mutableComputedStyle();
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698