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

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

Issue 23049008: Replace style sharing cousin list search with LRU (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating to ToT Created 7 years, 4 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 8c02630fe8c5c6f687b1d498b3a6b8f8956333e7..d422652307a099ba1e490012fd4a7b52a1ca5180 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1514,6 +1514,9 @@ bool Element::recalcStyle(StyleChange change)
change = Force;
else if (change != Force)
change = localChange;
+ } else {
+ // We still want to seed the style sharing list when just walking the tree to maximize sharing.
+ document()->styleResolver()->addToStyleSharingList(this);
}
StyleResolverParentPusher parentPusher(this);
@@ -1558,6 +1561,8 @@ bool Element::recalcStyle(StyleChange change)
if (shouldRecalcStyle(change, element)) {
parentPusher.push();
didReattach = element->recalcStyle(change);
+ } else {
+ document()->styleResolver()->addToStyleSharingList(element);
}
}

Powered by Google App Engine
This is Rietveld 408576698