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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Created 4 years, 1 month 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/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index a2ce787cc8e9cc6fcfb7bfad0ca1587b978746c2..f4191e44619a924dd61b532c45cb5450b9999b8a 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -779,7 +779,6 @@ void ContainerNode::detachLayoutTree(const AttachContext& context) {
for (Node* child = firstChild(); child; child = child->nextSibling())
child->detachLayoutTree(childrenContext);
- setChildNeedsStyleRecalc();
Node::detachLayoutTree(context);
}
@@ -1294,6 +1293,24 @@ void ContainerNode::recalcDescendantStyles(StyleRecalcChange change) {
lastTextNode = nullptr;
}
}
+ clearChildNeedsStyleRecalc();
+}
+
+void ContainerNode::rebuildDescendantLayoutTree() {
+ DCHECK(!needsStyleRecalc());
+ DCHECK(!childNeedsStyleRecalc());
+ DCHECK(!needsReattachLayoutTree());
+
+ for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ if (child->needsReattachLayoutTree() ||
+ child->childNeedsReattachLayoutTree()) {
+ if (child->isTextNode())
+ toText(child)->rebuildTextLayoutTree();
+ else if (child->isElementNode())
+ toElement(child)->rebuildLayoutTree();
+ }
+ }
+ clearChildNeedsReattachLayoutTree();
}
void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType,

Powered by Google App Engine
This is Rietveld 408576698