Commit Graph

6 Commits

Author SHA1 Message Date
Andreas Kling
9526dfbef3 LibWeb: Use fragment extents for orthogonal inline widths
Inline formatting contexts in vertical writing modes were measuring
intrinsic width from the line box width. That width still tracks the
line-height-sized horizontal span, so shrink-to-fit abspos sizing could
stay at 50px even when the text fragments only covered 25px.

Measure the physical horizontal extent from the line box fragments
instead, including the float-aware block formatting context path. This
makes orthogonal inline content report the correct intrinsic width.
2026-04-05 00:03:22 +02:00
Andreas Kling
9450fcb2b0 LibWeb: Fix grid abspos descendant placement
Use the absolutely positioned box's own grid placement to resolve the
grid-area containing block rectangle instead of inheriting the nearest
in-flow grid item's area.

Keep the grid-specific static-position handling for axes with both
insets auto, but resolve mixed auto and explicit grid placement axes
against the augmented grid for direct children as well as descendants
inside grid items.

This fixes the imported abspos and alignment WPTs for values like
grid-row: 1 and grid-column: auto / 1 while keeping the reduced
descendant regressions passing.
2026-04-04 14:35:50 +02:00
Andreas Kling
e2e8c04446 LibWeb: Add grid abspos descendant regression test
Add a focused grid layout test for absolutely positioned descendants
inside grid items. The test captures the current behavior of the left
inset resolving against the containing grid item instead of the abspos
box's own grid area, while preserving the static block position from
the in-flow grid item content.
2026-04-04 14:35:50 +02:00
Aliaksandr Kalenik
490377b76e LibWeb: Populate containing block chain in BFC min-height measurement
The throwaway BFC for min-height measurement may encounter abspos
elements whose CSS containing block is an ancestor above the subtree
root. Populate the entire containing block chain (not just the immediate
parent) so that ensure_used_values_for() finds pre-existing entries
instead of hitting the subtree root VERIFY.

Stop walking when the source state lacks an entry, which handles the
nested throwaway state case (e.g. min-height inside intrinsic sizing).
2026-03-03 22:37:38 +00:00
Aliaksandr Kalenik
81a6bba86e LibWeb: Add regression test for grid min-height with taller content
A grid container with min-height: 50px and a 200px tall child should
resolve to 200px height, not be clamped to min-height.
2026-03-03 22:37:38 +00:00
Aliaksandr Kalenik
35cf4ad79f Tests/LibWeb: Add test for grid min-content height with overflow:hidden
This test verifies that a grid container with height: min-content
correctly sizes its rows when grid items have overflow: hidden.
2026-02-19 03:07:15 +01:00