Revert "[LayoutNG] Handle OOF descendants stored in LegacyBlocks directly"
This reverts commit 48c013c2aa010a6ec57dd8b7532b728f552685ed.
Reason for revert: Suspected cause of webkit_layout_tests failure for virtual/layout_ng_experimental/fast/multicol/span/abspos-containing-block-outside-spanner.html
Original change's description:
> [LayoutNG] Handle OOF descendants stored in LegacyBlocks directly
>
> This CL changes how NG deals with OOF Elements held by Legacy.
>
> NG and Legacy use different mechanisms to "bind" OOF Elements
> to their container.
> NG binds OOF Elements to their container by propagating them
> up the tree during layout.
> Legacy LayoutBlocks keeps a list of PositionedObjects, and
> add and remove from this list directly from OOF child.
>
> The case tackled in this CL is this:
> NG is the container, and has a positioned child that
> has not propagated trought the tree during NG layout because
> Legacy was on a path between child and its container.
>
> For example:
> <div#container position:relative>
> <div#legacy display:flex>
> <div#oof position:absolute>
>
> When #container is placing OOF descendants, its NG
> list of descendants will not contain #oof, because
> #legacy was laid out with Legacy code. Instead, #oof
> is in the Legacy's list of #container.PositionedObjects.
>
> The interesting part here is computing the static position
> of #oof wrt #container.
>
> What previous code did was this:
> - it let Legacy decide when PositionedObjects are laid out.
> - when NG positioned object got called to Layout(), it
> would compute abspos constraints (static_position,
> constraint_space), create a new NGOutOfFlowLayoutPart
> - NGOutOfFlowLayoutPart would place the object
>
> The new code changes who triggers layout of these objects.
> Instead of waiting of Legacy to layout its positioned
> objects, it pulls them out of Legacy, and places them during
> NGOutOfFlowLayoutPart::Run.
>
> This makes computing static position for Legacy elements
> tricky. Container has not copied its data back to Legacy,
> and its children have not had their offset set.
> Legacy code that computes static offset needs children's
> offset, and that information is no longer available from
> LayoutObjects. That information can be found in
> NGContainerFragmentBuilder. That is why builder gets passed in
> to LayoutBlock::ComputeBlockStaticDistance
>
> The code also contains some minor fixes:
> 1) to bugs that were exposed by this change.
> 2) for bugs that would otherwise be caused by this change.
>
> NGContainerFragmentBuilder::AddChild needed to take
> relative position into account when propagating OOF
> descendants.
>
> NGContainerFragmentBuilder::GetChildOffset could be called
> on a grandchild, if child is a linebox.
>
> Bug: 921396
> Change-Id: Ib9a26596f21971374854cf6ec2729b10b3cd834a
> Reviewed-on: https://chromium-review.googlesource.com/c/1476087
> Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
> Commit-Queue: Aleks Totic <atotic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#634743}
TBR=ikilpatrick@chromium.org,atotic@chromium.org,mstensho@chromium.org
Change-Id: Ibf15ae8c091172f9365b0d8dc165fc9cb040618f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 921396,934972
Reviewed-on: https://chromium-review.googlesource.com/c/1483933
Reviewed-by: Kristi Park <kristipark@chromium.org>
Commit-Queue: Kristi Park <kristipark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634809}