From 3852168c84fa8b0e748160c8405b0cd39e01bcff Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Dec 2020 21:48:23 +0100 Subject: [PATCH] LibWeb: Compute final line box width *after* placing all fragments We were doing this after every fragment instead of after every line. --- Libraries/LibWeb/Layout/InlineFormattingContext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Libraries/LibWeb/Layout/InlineFormattingContext.cpp index 54e6c771079..d94f7ab04f0 100644 --- a/Libraries/LibWeb/Layout/InlineFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/InlineFormattingContext.cpp @@ -180,7 +180,9 @@ void InlineFormattingContext::run(Box&, LayoutMode layout_mode) if (is(fragment.layout_node())) dimension_box_on_line(downcast(fragment.layout_node()), layout_mode); + } + if (!line_box.fragments().is_empty()) { float left_edge = line_box.fragments().first().offset().x(); float right_edge = line_box.fragments().last().offset().x() + line_box.fragments().last().width(); float final_line_box_width = right_edge - left_edge;