LibWeb: When adding inline-block fragment to line, use border box width

We were only using the content box width for inline-block fragments,
which caused them to not to claim the space needed for padding+border.
This commit is contained in:
Andreas Kling 2020-12-07 21:47:13 +01:00
parent 05e1ecb3d0
commit 56ff2c112b
Notes: sideshowbarker 2024-07-19 01:00:08 +09:00

View file

@ -115,10 +115,10 @@ 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() + width() > available_width) {
if (layout_mode != LayoutMode::OnlyRequiredLineBreaks && 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, width(), height());
line_box->add_fragment(*this, 0, 0, border_box_width(), height());
}
}