commit | a72679ce5e5aa12bd77bdaa636f00ad5cdc1ca00 | [log] [tgz] |
---|---|---|
author | Aleks Totic <atotic@chromium.org> | Sat Jan 05 01:50:00 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Sat Jan 05 01:50:00 2019 |
tree | 955b5c6b35acc170ea86b8dbcf25e90f91574b01 | |
parent | a37db6203daeb49cbd87c3d253c57b05348c6bf3 [diff] |
[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}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .