From 6de10858b92227683be6fcb41a8d3f5a6439f132 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 11 Mar 2022 14:15:33 +0100 Subject: [PATCH] LibWeb: Only collapse vertical margin between BlockContainer siblings If there's some non-block-level box (like an SVG element of some kind) between to blocks, just skip over the non-block for purposes of margin collapsing. This is basically a hack, and something we'll need to improve as part of our general SVG support. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index b4597fc027..b0aa7d5a01 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -462,7 +462,7 @@ void BlockFormattingContext::place_block_level_element_in_normal_flow_vertically if (relevant_sibling_state.border_box_height() > 0) break; } - relevant_sibling = relevant_sibling->previous_sibling(); + relevant_sibling = relevant_sibling->previous_sibling_of_type(); } if (relevant_sibling) {