Commit 79925868 authored by Hayato Ito's avatar Hayato Ito Committed by Commit Bot

Don't recalc assignement in HTMLSlotElement::DetachLayoutTree

The workaround of https://crrev.com/c/1062990 is no longer necessary
because of https://crrev.com/c/1068646, which fixed ListItemOrdinal's behavior.

See also http://crbug.com/845770. In general, we should avoid recalc assignment
in detaching a node.

Bug: 776656, 845770
Change-Id: Ia98b35dce0b6d2e16829f79dde4b88470ced0d3f
Reviewed-on: https://chromium-review.googlesource.com/1070007Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561371}
parent 8972d1c0
...@@ -364,16 +364,9 @@ HTMLSlotElement::ChildrenInFlatTreeIfAssignmentIsSupported() { ...@@ -364,16 +364,9 @@ HTMLSlotElement::ChildrenInFlatTreeIfAssignmentIsSupported() {
void HTMLSlotElement::DetachLayoutTree(const AttachContext& context) { void HTMLSlotElement::DetachLayoutTree(const AttachContext& context) {
if (SupportsAssignment()) { if (SupportsAssignment()) {
// With incremental shadow dom, we need to make sure that assignment is
// recalcualted here. Unless that, assigned_nodes_ can be updated while in
// iterating it because node->LazyReattachIfAttached() might update
// assigned_nodes_. See http://crbug.com/843069#c8
const HeapVector<Member<Node>>& flat_tree_children = const HeapVector<Member<Node>>& flat_tree_children =
RuntimeEnabledFeatures::SlotInFlatTreeEnabled() RuntimeEnabledFeatures::SlotInFlatTreeEnabled() ? assigned_nodes_
? (RuntimeEnabledFeatures::IncrementalShadowDOMEnabled() : distributed_nodes_;
? AssignedNodes()
: assigned_nodes_)
: distributed_nodes_;
for (auto& node : flat_tree_children) for (auto& node : flat_tree_children)
node->LazyReattachIfAttached(); node->LazyReattachIfAttached();
} }
......
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