mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
Introduce AbsposContainingBlockInfo and a virtual resolve_abspos_containing_block_info() method on FormattingContext that computes the containing block rect, per-axis positioning mode (static position vs inset-from-rect), and optional grid alignment — all in one place. The base implementation handles the common case: padding-box rect of the containing block, with inline containing block support. GFC overrides it to return the grid area rect with alignment info. This replaces the per-context abspos loops that BFC, FFC, TFC, and GFC each had, with a shared layout_absolutely_positioned_children() + layout_absolutely_positioned_element() pair. The offset computation is simplified from ~40 lines of branching to a data-driven dispatch on the axis mode, and GFC's ~130-line custom layout method is replaced by a ~30-line resolve override.
104 KiB
104 KiB