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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Created 4 years, 6 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..abb5e45216633de1f2d3efdb88f616a512911781 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -567,7 +567,7 @@ void Element::nativeApplyScroll(ScrollState& scrollState)
// page removes the default applyScroll (ViewportScrollCallback).
if (document().effectiveRootScroller() == this)
boxToScroll = document().layoutView();
- else if (layoutObject())
+ else if (hasLayoutObject())
boxToScroll = toLayoutBox(layoutObject());
if (!boxToScroll)
@@ -1769,13 +1769,8 @@ 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;
+ setComputedStyle(newStyle);
+ return buildOwnLayout();
sashab 2016/07/04 07:57:12 A suggestion that might make this a little easier
nainar 2016/07/05 00:26:55 In progress update: Made a new CL with the mechani
}
DCHECK(oldStyle);
@@ -1814,6 +1809,17 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
return localChange;
}
+StyleRecalcChange Element::buildOwnLayout()
+{
+ AttachContext reattachContext;
+ reattachContext.resolvedStyle = mutableComputedStyle();
+ bool layoutObjectWillChange = needsAttach() || hasLayoutObject();
+ reattach(reattachContext);
+ if (layoutObjectWillChange || hasLayoutObject())
+ return Reattach;
+ return ReattachNoLayoutObject;
+}
+
void Element::updateCallbackSelectors(const ComputedStyle* oldStyle, const ComputedStyle* newStyle)
{
Vector<String> emptyVector;

Powered by Google App Engine
This is Rietveld 408576698