diff options
Diffstat (limited to 'Libraries/LibWeb/Layout/BlockBox.cpp')
-rw-r--r-- | Libraries/LibWeb/Layout/BlockBox.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/BlockBox.cpp b/Libraries/LibWeb/Layout/BlockBox.cpp index 00a0f90c64..b01db3f579 100644 --- a/Libraries/LibWeb/Layout/BlockBox.cpp +++ b/Libraries/LibWeb/Layout/BlockBox.cpp @@ -117,7 +117,9 @@ void BlockBox::split_into_lines(InlineFormattingContext& context, LayoutMode lay float available_width = context.available_width_at_line(containing_block.line_boxes().size() - 1); - if (layout_mode != LayoutMode::OnlyRequiredLineBreaks && line_box->width() > 0 && line_box->width() + border_box_width() > available_width) { + if (layout_mode == LayoutMode::AllPossibleLineBreaks && line_box->width() > 0) { + line_box = &containing_block.add_line_box(); + } else if (layout_mode == LayoutMode::Default && line_box->width() > 0 && line_box->width() + border_box_width() > available_width) { line_box = &containing_block.add_line_box(); } line_box->add_fragment(*this, 0, 0, border_box_width(), height()); |