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

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

Issue 2821193003: Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document. (Closed)
Patch Set: Revert back to rune@'s lgtmed patch Created 3 years, 8 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/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | 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 3f31f0a9877d3845d5260312a9899c18ed08faaf..4bab59a53de94c074d4e794151a2a72d2e96856d 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2016,7 +2016,7 @@ StyleRecalcChange Element::RecalcOwnStyle(StyleRecalcChange change) {
}
if (local_change == kReattach) {
- GetDocument().AddNonAttachedStyle(*this, std::move(new_style));
+ SetNonAttachedStyle(std::move(new_style));
SetNeedsReattachLayoutTree();
return kReattach;
}
@@ -2072,11 +2072,12 @@ void Element::RebuildLayoutTree(Text* next_text_sibling) {
if (NeedsReattachLayoutTree()) {
AttachContext reattach_context;
- reattach_context.resolved_style = GetDocument().GetNonAttachedStyle(*this);
+ reattach_context.resolved_style = GetNonAttachedStyle();
bool layout_object_will_change = NeedsAttach() || GetLayoutObject();
ReattachLayoutTree(reattach_context);
if (layout_object_will_change || GetLayoutObject())
ReattachWhitespaceSiblingsIfNeeded(next_text_sibling);
+ SetNonAttachedStyle(nullptr);
} else if (ChildNeedsReattachLayoutTree()) {
DCHECK(!NeedsReattachLayoutTree());
SelectorFilterParentScope filter_scope(*this);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698