summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-17 01:42:03 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-17 01:42:03 +0100
commitf0a4a6bb11841256c34ced00b80aa7693a3ffbab (patch)
tree2e1d964ec84282fa3884debd3dd37c54692a59e0
parentf35f605a24f4e26864647daf3648e3de03e8bc81 (diff)
downloadserenity-f0a4a6bb11841256c34ced00b80aa7693a3ffbab.zip
LibWeb: Always break around inline-blocks in AllPossibleLineBreaks mode
-rw-r--r--Libraries/LibWeb/Layout/BlockBox.cpp4
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());