1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

LibWeb: Bring CSS line-height implementation closer to spec

We now distribute the line-height evenly between the space above and
below inline-level boxes. This noticeably improves our baseline
alignment in many cases.

Note that the "vertical-align: <length>" case is quite awkward, as the
extra height added by the offset baseline must count towards the line
box height.

There's a lot of room for improvement here, but this makes the buckets
container on Acid3 show up in the right place, with the right size.
This commit is contained in:
Andreas Kling 2022-03-24 22:45:51 +01:00
parent 430559ea51
commit 195ef5e26f
6 changed files with 79 additions and 9 deletions

View file

@ -16,6 +16,7 @@ public:
LineBox() = default;
float width() const { return m_width; }
float height() const { return m_height; }
float bottom() const { return m_bottom; }
float baseline() const { return m_baseline; }
@ -36,6 +37,7 @@ private:
Vector<LineBoxFragment> m_fragments;
float m_width { 0 };
float m_height { 0 };
float m_bottom { 0 };
float m_baseline { 0 };
};