1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

LibWeb: Teach line layout to collapse whitespace across fragments

This kind of HTML now produces a single piece of whitespace:

<span> </span> <span> </span> <span> </span>

We achieve this by checking if the last fragment on the last line ends
in whitespace. If so, we either don't add a fragment at all (for the
current chunk) or we simply skip over all whitespace at the head of
the current chunk (instead of collapsing it to a single ' '.)
This commit is contained in:
Andreas Kling 2020-06-13 14:59:17 +02:00
parent 4ab1b0b436
commit 07ccaa1934
Notes: sideshowbarker 2024-07-19 05:40:25 +09:00
5 changed files with 46 additions and 15 deletions

View file

@ -45,6 +45,8 @@ public:
void trim_trailing_whitespace();
bool ends_in_whitespace() const;
private:
friend class LayoutBlock;
NonnullOwnPtrVector<LineBoxFragment> m_fragments;