LibWeb: Place normal-flow blocks relative to non-absolute siblings

We could previously place a box next to a preceding sibling with
position:fixed, which is wrong since fixed-position elements are taken
out of the normal flow.
This commit is contained in:
Andreas Kling 2020-06-25 15:16:43 +02:00
parent b2f54be514
commit bab0143bb2
Notes: sideshowbarker 2024-07-19 05:23:26 +09:00

View file

@ -627,7 +627,7 @@ void LayoutBlock::place_block_level_non_replaced_element_in_normal_flow(LayoutBl
auto* relevant_sibling = block.previous_sibling();
while (relevant_sibling != nullptr) {
if (relevant_sibling->style().position() != CSS::Position::Absolute)
if (!relevant_sibling->is_absolutely_positioned())
break;
relevant_sibling = relevant_sibling->previous_sibling();
}