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

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

Issue 2398293003: Move Layout Tree Construction code into Element::rebuildLayoutTree() (Closed)
Patch Set: Clear nextTextSibling pointer where there is a LayoutObject between the element and text node Created 4 years, 2 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/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index b6bf406adb3685974276aad6c3a2847d9b969f89..88d3de4292cbf220f6e403886459dca023eafc55 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -697,6 +697,17 @@ void Node::markAncestorsWithChildNeedsStyleRecalc() {
document().scheduleLayoutTreeUpdateIfNeeded();
}
+void Node::markAncestorsWithChildNeedsReattachLayoutTree() {
+ for (ContainerNode* p = parentOrShadowHostNode();
+ p && !p->childNeedsReattachLayoutTree(); p = p->parentOrShadowHostNode())
+ p->setChildNeedsReattachLayoutTree();
+}
+
+void Node::setNeedsReattachLayoutTree() {
+ setFlag(NeedsReattachLayoutTree);
+ markAncestorsWithChildNeedsReattachLayoutTree();
+}
+
void Node::setNeedsStyleRecalc(StyleChangeType changeType,
const StyleChangeReasonForTracing& reason) {
DCHECK(changeType != NoStyleChange);
@@ -888,6 +899,7 @@ void Node::attachLayoutTree(const AttachContext&) {
(layoutObject()->parent() || layoutObject()->isLayoutView())));
clearNeedsStyleRecalc();
+ clearNeedsReattachLayoutTree();
if (AXObjectCache* cache = document().axObjectCache())
cache->updateCacheAfterNodeIsAttached(this);

Powered by Google App Engine
This is Rietveld 408576698