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

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

Issue 2376453004: Stash ComputedStyles on new HeapHashMap on Document. (Closed)
Patch Set: Post LGTM with nits changes Created 4 years, 2 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 | « third_party/WebKit/Source/core/dom/Element.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 933ae095265de2f12f0e572a266351581ee60336..4a2acb0be1fb8b59d46f520b08199aa8ee777ae8 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1946,10 +1946,8 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change) {
}
if (localChange == Reattach) {
- // TODO(nainar): Remove the style parameter being passed into
- // buildLayoutTree(). ComputedStyle will now be stored on Node and accessed
- // in buildLayoutTree() using mutableComputedStyle().
- return rebuildLayoutTree(*newStyle);
+ document().addNonAttachedStyle(*this, std::move(newStyle));
+ return rebuildLayoutTree();
}
DCHECK(oldStyle);
@@ -1991,9 +1989,9 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change) {
return localChange;
}
-StyleRecalcChange Element::rebuildLayoutTree(ComputedStyle& newStyle) {
+StyleRecalcChange Element::rebuildLayoutTree() {
AttachContext reattachContext;
- reattachContext.resolvedStyle = &newStyle;
+ reattachContext.resolvedStyle = document().getNonAttachedStyle(*this);
bool layoutObjectWillChange = needsAttach() || layoutObject();
reattachLayoutTree(reattachContext);
if (layoutObjectWillChange || layoutObject())
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698