Commit 0effd07
committed
Incorrectly positioned out-of-flow box when layout boundary is present
https://bugs.webkit.org/show_bug.cgi?id=254666
Reviewed by Antti Koivisto.
Consider the following case:
<containing-block>
<layout-boundary>
Inline-content
<out-of-flow-box>
</layout-boundary>
</containing-block>
e.g. <div style="overflow: hidden">
some text
<div style="position: absolute"></div>
</div>
1. "inline content" gets mutated and the associated renderers are marked dirty.
During #1 we climb the ancestor chain and mark containing blocks dirty to ensure the subsequent layout has a correct entry point.
We either (most of the time) stop at the ICB (RenderView) during this walk or at a layout-boundary.
2. Subsequent layout is initiated starting at layout-boundary.
The geometry of the freshly laid out inline-content may affect the out-of-flow-box's static position.
In inline layout code (both legacy and IFC) at this point we only set the "static" position assuming
that layout eventually reaches the out-of-flow-box's containing block which would set the final top/left coords.
However since this layout is bound to layout-boundary's subtree, we never get to the containing-block.
While this is an invalidation bug where we fail to mark the containing-block dirty (by not stopping at layout-boundary),
it's expensive to figure out if there's a descendent of the layout-boundary with an ancestor containing block (outside of layout-boundary's subtree).
Instead set the out-of-flow-box's coordinates here at inline layout and let the containing block update it as part of the normal layout flow
(when we actually get to the containing block).
This is technically correct since this renderer's position is its static position until
the containing block updates it as applicable (and the special "static position" handling could be considered as a render tree artifact).
* LayoutTests/fast/block/positioning/static_out_of_flow_inside_layout_boundary-expected.html: Added.
* LayoutTests/fast/block/positioning/static_out_of_flow_inside_layout_boundary.html: Added.
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateRenderTreePositions):
Canonical link: https://commits.webkit.org/262470@main1 parent 4bfd15d commit 0effd07
File tree
4 files changed
+49
-1
lines changed- LayoutTests
- fast/block/positioning
- Source/WebCore/layout/integration/inline
4 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3671 | 3671 | | |
3672 | 3672 | | |
3673 | 3673 | | |
| 3674 | + | |
3674 | 3675 | | |
3675 | 3676 | | |
3676 | 3677 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
676 | | - | |
| 677 | + | |
| 678 | + | |
677 | 679 | | |
678 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
679 | 686 | | |
680 | 687 | | |
681 | 688 | | |
| 689 | + | |
682 | 690 | | |
683 | 691 | | |
684 | 692 | | |
| |||
0 commit comments