1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

LibWeb: Don't justify text lines that end in a forced break

These are treated the same as the last line in a block, per CSS-TEXT-3.
This commit is contained in:
Andreas Kling 2023-06-10 15:49:17 +02:00
parent 358a4fe3cb
commit 79d2c9f3e8
6 changed files with 106 additions and 12 deletions

View file

@ -25,10 +25,11 @@ LineBuilder::~LineBuilder()
update_last_line();
}
void LineBuilder::break_line(Optional<CSSPixels> next_item_width)
void LineBuilder::break_line(ForcedBreak forced_break, Optional<CSSPixels> next_item_width)
{
auto last_line_box = ensure_last_line_box();
auto& last_line_box = ensure_last_line_box();
last_line_box.m_has_break = true;
last_line_box.m_has_forced_break = forced_break == ForcedBreak::Yes;
update_last_line();
size_t break_count = 0;