1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

LibWeb: Skip over floating elements when collapsing margins

Two sibling blocks are not vertically adjacent if one is float:left
and the other is float:none. Respect this when collapsing margins.
This commit is contained in:
Andreas Kling 2020-06-26 15:09:14 +02:00
parent 62daa6f73c
commit ba76a72422

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->is_absolutely_positioned())
if (!relevant_sibling->is_absolutely_positioned() && !relevant_sibling->is_floating())
break;
relevant_sibling = relevant_sibling->previous_sibling();
}