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

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: post Sasha's comments 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
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 190d1908070ca33a5920d6240e84c09f3b46732a..3a0db58ee26d3e10ffe3db430318eaf0d574f0e7 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1769,13 +1769,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.get());
}
DCHECK(oldStyle);
@@ -1814,6 +1811,17 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
return localChange;
}
+StyleRecalcChange Element::buildOwnLayout(ComputedStyle* newStyle)
+{
sashab 2016/07/05 23:28:55 DCHECK(newstyle) here
sashab 2016/07/05 23:28:55 DCHECK(newstyle) here
nainar 2016/07/06 00:52:09 Done.
+ 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;
« third_party/WebKit/Source/core/dom/Element.h ('K') | « 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