mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb: Improve the line breaking algorithm
Check the width of the next token after white space to decide line breaks. The next width can also be the total width of multiple tokens. This better follows the CSS Text specification and matches behavior of other browsers. Fixes #20388.
This commit is contained in:
parent
33b133d3f4
commit
3d7e788981
Notes:
sideshowbarker
2024-07-17 03:03:37 +09:00
Author: https://github.com/axgallo
Commit: 3d7e788981
Pull-request: https://github.com/SerenityOS/serenity/pull/20657
Issue: https://github.com/SerenityOS/serenity/issues/20388
Reviewed-by: https://github.com/awesomekling
9 changed files with 227 additions and 13 deletions
|
@ -52,8 +52,10 @@ public:
|
|||
InlineLevelIterator(Layout::InlineFormattingContext&, LayoutState&, Layout::BlockContainer const&, LayoutMode);
|
||||
|
||||
Optional<Item> next();
|
||||
CSSPixels next_non_whitespace_sequence_width();
|
||||
|
||||
private:
|
||||
Optional<Item> next_without_lookahead();
|
||||
void skip_to_next();
|
||||
void compute_next();
|
||||
|
||||
|
@ -96,6 +98,7 @@ private:
|
|||
Optional<ExtraBoxMetrics> m_extra_trailing_metrics;
|
||||
|
||||
Vector<JS::NonnullGCPtr<NodeWithStyleAndBoxModelMetrics const>> m_box_model_node_stack;
|
||||
Queue<InlineLevelIterator::Item> m_lookahead_items;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue