mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibWeb: When collapsing margins, consider border box heights
Empty boxes should be fully collapsed, but a box with border and/or padding is not empty. This fixes an issue where <hr> elements were getting weirdly collapsed since they have zero content height (but some border height.)
This commit is contained in:
parent
5116b94114
commit
bf3772362a
2 changed files with 7 additions and 1 deletions
|
@ -548,7 +548,7 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl
|
|||
while (relevant_sibling != nullptr) {
|
||||
if (!relevant_sibling->is_absolutely_positioned() && !relevant_sibling->is_floating()) {
|
||||
collapsed_bottom_margin_of_preceding_siblings = max(collapsed_bottom_margin_of_preceding_siblings, relevant_sibling->box_model().margin.bottom);
|
||||
if (relevant_sibling->height() > 0)
|
||||
if (relevant_sibling->border_box_height() > 0)
|
||||
break;
|
||||
}
|
||||
relevant_sibling = relevant_sibling->previous_sibling();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue