From ed1576eea88876a4e21bc59faeecd2c481b3ecec Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 24 Mar 2022 12:36:16 +0100 Subject: [PATCH] LibWeb: Align baseline of inline-block with non-zero top border/padding We were not adjusting the fragment baseline for inline-blocks that had some border and/or padding size up top. --- Userland/Libraries/LibWeb/Layout/LineBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp index 1aae5583b8..fcb82cbf09 100644 --- a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp @@ -98,7 +98,7 @@ static float box_baseline(FormattingState const& state, Box const& box) { auto const& box_state = state.get(box); if (!box_state.line_boxes.is_empty()) - return box_state.offset.y() + box_state.line_boxes.last().baseline(); + return box_state.border_box_top() + box_state.offset.y() + box_state.line_boxes.last().baseline(); if (box.has_children() && !box.children_are_inline()) { auto const* child_box = box.last_child_of_type(); VERIFY(child_box);