From 45db35ad043b8dc33b747c1869078b558f565747 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 8 Apr 2022 23:12:04 +0200 Subject: [PATCH] LibWeb: Fix double-sized box model metrics on inline replaced elements We were mistakenly treating inline replaced elements as if they are the start of a regular display:inline element. This meant that we collected the horizontal start and end metrics from the box model, and then added those to the inline-level item produced by InlineLevelIterator. This effectively meant that , and other replaced elements got double-sized values for margin/border/padding on the left and right sides. (Which manifested as a mysterious margin around the element.) --- Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp index bb170e7536..4c2c9d980e 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp @@ -108,7 +108,7 @@ void InlineLevelIterator::compute_next() void InlineLevelIterator::skip_to_next() { - if (m_next_node && is(*m_next_node) && !m_next_node->is_inline_block() && !m_next_node->is_out_of_flow(m_inline_formatting_context)) + if (m_next_node && is(*m_next_node) && !m_next_node->is_inline_block() && !m_next_node->is_out_of_flow(m_inline_formatting_context) && !is(m_next_node)) enter_node_with_box_model_metrics(static_cast(*m_next_node)); m_current_node = m_next_node;