浏览代码

LibWeb: Compute final line box width *after* placing all fragments

We were doing this after every fragment instead of after every line.
Andreas Kling 4 年之前
父节点
当前提交
3852168c84
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Libraries/LibWeb/Layout/InlineFormattingContext.cpp

+ 2 - 0
Libraries/LibWeb/Layout/InlineFormattingContext.cpp

@@ -180,7 +180,9 @@ void InlineFormattingContext::run(Box&, LayoutMode layout_mode)
 
             if (is<Box>(fragment.layout_node()))
                 dimension_box_on_line(downcast<Box>(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;