From 6f74eaed4291f4e079fffceb20c4d2d4081dbafc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 9 Oct 2020 21:27:34 +0200 Subject: [PATCH] LibWeb: Don't collapse blocks into the previous sibling's padding We were forgetting to account for the padding-bottom of the previous relevant sibling when placing blocks vertically. --- Libraries/LibWeb/Layout/LayoutBlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp index 3a915753bc..073bc24267 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.cpp +++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp @@ -647,7 +647,7 @@ void LayoutBlock::place_block_level_non_replaced_element_in_normal_flow(LayoutBl } if (relevant_sibling) { - y += relevant_sibling->effective_offset().y() + relevant_sibling->height(); + y += relevant_sibling->effective_offset().y() + relevant_sibling->height() + relevant_sibling->box_model().padding.bottom.to_px(*relevant_sibling); // Collapse top margin with bottom margin of preceding siblings if needed float my_margin_top = box.margin.top.to_px(*this);