mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
Fixes incorrect static positioning of absolutely positioned elements nested within a block that has `margin-top` inside an inline element. Added two lines of code to `AnonymousBlockBox::layout_into_line_items` in components/layout/flow/inline/mod.rs: - We snapshot the current positioning_context_length before laying out the block. - We call `adjust_static_position_of_hoisted_fragments` on the positioning_context after the block fragment is placed by the state. Testing: Tested the fix using the manual reproduction HTML provided in the issue, Also ran the existing WPT tests in `tests/wpt/tests/css/css-position/` to ensure there are no regressions. Fixes: #42890 --------- Signed-off-by: vinayak sharma <vinayaks0111@gmail.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>