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 8e46d3dcbe026f9a26ed270f24ef6521456dc4b5..4e8590dceafaff99afb674cfe8e3170f6b7bd1dc 100644 |
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
@@ -1297,6 +1297,23 @@ void ContainerNode::recalcDescendantStyles(StyleRecalcChange change) { |
} |
} |
+void ContainerNode::rebuildDescendantLayoutTrees() { |
+ DCHECK(!needsStyleRecalc()); |
+ 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(); |
+ } |
+ } |
+ clearChildNeedsStyleRecalc(); |
+ clearChildNeedsReattachLayoutTree(); |
+} |
+ |
void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, |
Element* changedElement, |
Node* nodeBeforeChange, |