mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +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:
parent
430559ea51
commit
195ef5e26f
6 changed files with 79 additions and 9 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue