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

Unified Diff: Source/core/dom/Element.cpp

Issue 15680005: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated test and test expectations Created 7 years, 7 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index f1676dd89408cfae9f6ce1eac58c1c09663cecd6..33c8cd5b322f0294c6b00618de2b8af9394e11de 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1388,7 +1388,12 @@ void Element::recalcStyle(StyleChange change)
// common, especially during lazy attach.
newStyle = styleForRenderer();
localChange = Node::diff(currentStyle.get(), newStyle.get(), document());
+ } else if (isActiveInsertionPoint(this) && attached()) {
+ // Active Insertion points are special: They never have renderers and reattach()-ing their subtrees is just a waste.
+ // We can just skip Element-local style updates for them.
+ localChange = change;
}
+
if (localChange == Detach) {
// FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along.
reattach();

Powered by Google App Engine
This is Rietveld 408576698