mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-14 19:06:35 +02:00
Replace content_box_rect_in_static_position_ancestor_coordinate_space() which walked the ancestor chain to compute the offset between an abspos element's static position containing block and its actual containing block. Instead, add a cumulative_offset() method to UsedValues that computes the absolute offset from the ICB to a box's content edge by walking the containing block chain. For pre-populated nodes during partial relayout, it returns a cached value from the paintable's absolute position. The static-CB-to-actual-CB offset is now a simple subtraction of two cumulative offsets, which also fixes a bug where table cells with position:relative ancestors got incorrect static positions due to the old function accumulating offsets in the wrong coordinate space. Also route direct UsedValues::offset assignments in Flex, Grid, and Table formatting contexts through set_content_offset().
37 KiB
37 KiB