mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:37:34 +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:
parent
358a4fe3cb
commit
79d2c9f3e8
6 changed files with 106 additions and 12 deletions
|
@ -18,7 +18,12 @@ public:
|
|||
LineBuilder(InlineFormattingContext&, LayoutState&);
|
||||
~LineBuilder();
|
||||
|
||||
void break_line(Optional<CSSPixels> next_item_width = {});
|
||||
enum class ForcedBreak {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
void break_line(ForcedBreak, Optional<CSSPixels> next_item_width = {});
|
||||
void append_box(Box const&, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin);
|
||||
void append_text_chunk(TextNode const&, size_t offset_in_node, size_t length_in_node, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height);
|
||||
|
||||
|
@ -26,7 +31,7 @@ public:
|
|||
bool break_if_needed(CSSPixels next_item_width)
|
||||
{
|
||||
if (should_break(next_item_width)) {
|
||||
break_line(next_item_width);
|
||||
break_line(LineBuilder::ForcedBreak::No, next_item_width);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue