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

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

Issue 2118393002: Reorganize Layout Tree Construction code to be its own function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final patch for landinh Created 4 years, 5 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 c629e44e6990fabdeb60bb1f746c2c3e3b8dcffc..67e29c95e205616ad139015f196de9e2d76be911 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1771,13 +1771,10 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
}
if (localChange == Reattach) {
- AttachContext reattachContext;
- reattachContext.resolvedStyle = newStyle.get();
- bool layoutObjectWillChange = needsAttach() || layoutObject();
- reattach(reattachContext);
- if (layoutObjectWillChange || layoutObject())
- return Reattach;
- return ReattachNoLayoutObject;
+ // TODO(nainar): Remove the style parameter being passed into buildOwnLayout().
+ // ComputedStyle will now be stored on Node and accessed in buildOwnLayout()
+ // using mutableComputedStyle().
+ return buildOwnLayout(*newStyle);
}
DCHECK(oldStyle);
@@ -1816,6 +1813,17 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
return localChange;
}
+StyleRecalcChange Element::buildOwnLayout(ComputedStyle& newStyle)
+{
+ AttachContext reattachContext;
+ reattachContext.resolvedStyle = &newStyle;
+ bool layoutObjectWillChange = needsAttach() || layoutObject();
+ reattach(reattachContext);
+ if (layoutObjectWillChange || layoutObject())
+ return Reattach;
+ return ReattachNoLayoutObject;
+}
+
void Element::updateCallbackSelectors(const ComputedStyle* oldStyle, const ComputedStyle* newStyle)
{
Vector<String> emptyVector;
« 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