[LayoutNG] OOF inline containing box for continuations

This is a possible way to fix:
external/wpt/css/CSS2/abspos/abspos-in-block-in-inline-in-relpos-inline.html

The problem:
Split inlines generate LayoutTree that looks something like this:
LayoutNGBlockFlow DIV style="height:200px;"
  LayoutNGBlockFlow (anonymous)
    LayoutInline (relative positioned) continuation=0x3c190 SPAN id="containingBlock"
  LayoutNGBlockFlow (anonymous) (relative positioned)
    LayoutNGBlockFlow (positioned) DIV id="target"
  LayoutNGBlockFlow (anonymous)
    LayoutInline (relative positioned) SPAN id="notContainingBlock"
      LayoutInline (relative positioned) 0x3c190 SPAN id="containingBlock"

#target is OOF, with SPAN.#containingBlockOfTarget OOF containing block.

Containing block boundaries are defined by LayoutInline which
is split by continuations into 2 LayoutInline.
Even worse, #target does not have containingBlock in parent chain.

Legacy handles only parts of this problem:
containing block static position, and width are
found by traversing anonymous parent continuation chain.
Location/height of containing LayoutInline are not handled.

I think we can fix this correctly, but it is a little tricky.

Step 1 is to detect when our NGOutOfFlowLayoutPart container is
Anonymous + Relative Position (signal Legacy uses to trigger).
When this happens, we can traverse Anonymous continuation to
find LayoutInline which is the true css container. Then we
let #target bubble to parent, and let parent position it.

Step 2 is positioning by anonymous's parent. This is slightly
different from what we did before, because parent needs to find
inline containing block bounds, but is not ChildrenInline().
Instead, it needs to find those bounds by traversing
anonymous children's lineboxes.

Step 3 is correcting offset generated by NGOutOfFlowLayoutPart::LayoutDescendant
Paint layer expect offset from css containing block, so we generate
that.

This is very much an edge case in our test suite. There are only
3 tests that hit "split inline is a containing block". They all pass now.

Bug: 740993
Change-Id: I694dfa277d6579ee1b775122d8216cfbbad81301
Reviewed-on: https://chromium-review.googlesource.com/c/1374910
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620149}
7 files changed