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

LibWeb: Add cap and rcap Length units

As noted, the ascent of the font is not the best heuristic for this, but
it is one that's listed as OK to use by the spec:

> In the cases where it is impossible or impractical to determine the
  cap-height, the font’s ascent must be used.
This commit is contained in:
Sam Atkins 2023-04-28 17:10:30 +01:00 committed by Andreas Kling
parent a8e0fa403a
commit 03ed37eb14
2 changed files with 20 additions and 0 deletions

View file

@ -22,6 +22,8 @@ public:
Rem,
Ex,
Rex,
Cap,
Rcap,
Ch,
Rch,
Lh,
@ -51,6 +53,7 @@ public:
CSSPixels font_size;
CSSPixels x_height;
CSSPixels cap_height;
CSSPixels zero_advance;
CSSPixels line_height;
};
@ -87,6 +90,8 @@ public:
|| m_type == Type::Rem
|| m_type == Type::Ex
|| m_type == Type::Rex
|| m_type == Type::Cap
|| m_type == Type::Rcap
|| m_type == Type::Ch
|| m_type == Type::Rch
|| m_type == Type::Lh