1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibWeb: Don't offset abspos children of flex container by padding twice

We were incorrectly offsetting the static position of abspos children of
flex containers by the padding twice. This was a misguided attempt to
adjust to the abspos containing block being the padding box, not the
content box.

Fixes #21344.
This commit is contained in:
Andreas Kling 2023-10-08 08:23:27 +02:00
parent a86531809e
commit 3250a424f0
3 changed files with 37 additions and 8 deletions

View file

@ -2240,14 +2240,6 @@ CSSPixelPoint FlexFormattingContext::calculate_static_position(Box const& box) c
break;
}
// NOTE: Next, we add the flex container's padding since abspos boxes are placed relative to the padding edge
// of their abspos containing block.
if (pack_from_end) {
main_offset += is_row_layout() ? m_flex_container_state.padding_right : m_flex_container_state.padding_bottom;
} else {
main_offset += is_row_layout() ? m_flex_container_state.padding_left : m_flex_container_state.padding_top;
}
if (pack_from_end)
main_offset += inner_main_size(flex_container()) - inner_main_size(box) - main_border_before - main_border_after;