mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
LibWeb: Don't append collapsible whitespace to start of new line
After performing a required line break, and the next text chunk is all collapsible whitespace, simply discard the whitespace.
This commit is contained in:
parent
de53eb825a
commit
d32630e17b
2 changed files with 10 additions and 3 deletions
|
@ -257,7 +257,10 @@ void InlineFormattingContext::generate_line_boxes(LayoutMode layout_mode)
|
|||
|
||||
case InlineLevelIterator::Item::Type::Text: {
|
||||
auto& text_node = verify_cast<Layout::TextNode>(*item.node);
|
||||
line_builder.break_if_needed(layout_mode, item.border_box_width(), item.should_force_break);
|
||||
if (line_builder.break_if_needed(layout_mode, item.border_box_width(), item.should_force_break)) {
|
||||
if (item.is_collapsible_whitespace)
|
||||
break;
|
||||
}
|
||||
line_builder.append_text_chunk(
|
||||
text_node,
|
||||
item.offset_in_node,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue