DescriptionRebuild layout tree in flat tree order.
Marking the DOM for layout tree rebuild and the actual rebuilding is
now contained in the lifecycle update at a point where the shadow dom
distribution is up-to-date. We can therefore safely mark the flat-tree
ancestor chain without risking that it's broken by a distribution.
The point of doing RebuildLayoutTree in flat tree order is that layout
boxes can then be re-attached in the layout tree order which makes it
simpler to handle whitespace reattachment. For shadow trees and slotted
elements, when using the shadow-including tree order, we could have
elements rebuild their layout boxes in an order arbitrarily decided by
the slot assignments and slot positions in the shadow tree.
Note that while the RebuildLayoutTree traversal used to happen in the
shadow-including order, the layout attachment already happens in the
flat tree order.
See [1] for a plan to fix correctness and performance of whitespace
re-attachment.
This CL is doing the following changes:
1. Modify MarkAncestorsWithChildNeedsReattachLayoutTree to mark flat
tree ancestry.
2. Rebuild distributed children for InsertionPoint and HTMLSlotElement.
These children were rebuilt after their host's shadow tree before
this change.
3. Factored out RebuildLayoutTreeForChild() as common code for both
walking light tree children in ContainerNode, and distributed
children in InsertionPoint and HTMLSlotElement.
4. Made FinalDestinationSlot() a member of node instead of a static
function as it is now needed in multiple files.
[1] http://bit.ly/2ozyBdx
Review-Url: https://codereview.chromium.org/2836753002
Cr-Commit-Position: refs/heads/master@{#471188}
Committed: https://chromium.googlesource.com/chromium/src/+/5e53c60ebe374282c8c2864a8e6d1d864afa221a
Patch Set 1 #Patch Set 2 : Mark host ancestor for non-slotted. #Patch Set 3 : Rebased #Patch Set 4 : Removed in-progress work #Patch Set 5 : Made FinalDestinationSlot a method on Node. #Patch Set 6 : Rebased #Messages
Total messages: 20 (10 generated)
|