1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

LibHTML: Remove trailing whitespace in line boxes

After the splitting-into-lines pass, remove any trailing whitespace
from all of a block's line boxes.

This improves the appearance of text-align: justify/right :^)
This commit is contained in:
Andreas Kling 2019-10-20 17:18:28 +02:00
parent 570c6c8458
commit 3bd29ad98c
5 changed files with 52 additions and 10 deletions

View file

@ -14,7 +14,9 @@ public:
const Vector<LineBoxFragment>& fragments() const { return m_fragments; }
Vector<LineBoxFragment>& fragments() { return m_fragments; }
void trim_trailing_whitespace();
private:
friend class LayoutBlock;
Vector<LineBoxFragment> m_fragments;
float m_width { 0 };
};