Commit 8926296d authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Use FlatTreeParentChanged() for re-distributed v0 shadow nodes.

Getting rid of LazyReattachIfAttached for shadow DOM.

FlatTreeParentChanged() will mark the node for kLocalStyleChangestyle
style recalc (for new inheritance parent), and forced re-attachment in
the next lifecycle update instead of doing a synchronous
DetachLayoutTree() first.

Bug: 925826
Change-Id: Ia14964f855bfea35089b66d11c9412fe22800813
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1591620Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#655971}
parent eee9fbdf
......@@ -67,7 +67,7 @@ void V0InsertionPoint::SetDistributedNodes(
for (; j < distributed_nodes.size() &&
distributed_nodes_.at(i) != distributed_nodes.at(j);
++j)
distributed_nodes.at(j)->LazyReattachIfAttached();
distributed_nodes.at(j)->FlatTreeParentChanged();
if (j == distributed_nodes.size())
break;
} else if (distributed_nodes_.size() > distributed_nodes.size()) {
......@@ -76,13 +76,13 @@ void V0InsertionPoint::SetDistributedNodes(
for (; i < distributed_nodes_.size() &&
distributed_nodes_.at(i) != distributed_nodes.at(j);
++i)
distributed_nodes_.at(i)->LazyReattachIfAttached();
distributed_nodes_.at(i)->FlatTreeParentChanged();
if (i == distributed_nodes_.size())
break;
} else if (distributed_nodes_.at(i) != distributed_nodes.at(j)) {
// If both distributions are the same length reattach both old and new.
distributed_nodes_.at(i)->LazyReattachIfAttached();
distributed_nodes.at(j)->LazyReattachIfAttached();
distributed_nodes_.at(i)->FlatTreeParentChanged();
distributed_nodes.at(j)->FlatTreeParentChanged();
}
}
......@@ -90,10 +90,10 @@ void V0InsertionPoint::SetDistributedNodes(
// nodes.
for (; i < distributed_nodes_.size(); ++i)
distributed_nodes_.at(i)->LazyReattachIfAttached();
distributed_nodes_.at(i)->FlatTreeParentChanged();
for (; j < distributed_nodes.size(); ++j)
distributed_nodes.at(j)->LazyReattachIfAttached();
distributed_nodes.at(j)->FlatTreeParentChanged();
distributed_nodes_.Swap(distributed_nodes);
// Deallocate a Vector and a HashMap explicitly so that
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment