1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:07:45 +00:00

LibWeb: Handle CSS "ch" length unit (mostly)

This isn't 100% spec complaint, as it should use glyph_height()
depending on what the value of the writing-mode is, but we haven't
implemented it yet, so I think it'll be good enough for now.

This can be tested in https://wpt.live/css/css-values/ch-unit-008.html
Other css-unit tests fail as:
- 001 shows an issue related to a renderer (looks to me like you can't
  pass a width and height property to a span -- adding `display: block`
  to it passes the test),
- 002-004 and 009-012 use mentioned writing-mode,
- 016-017 loads custom fonts, which we also don't support (yet).
This commit is contained in:
Karol Kosek 2021-08-05 16:31:15 +02:00 committed by Andreas Kling
parent a230524c46
commit ffa7da0ca5
3 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,7 @@ public:
Pc,
Ex,
Em,
Ch,
Rem,
Vh,
Vw,
@ -93,6 +94,7 @@ public:
{
return m_type == Type::Ex
|| m_type == Type::Em
|| m_type == Type::Ch
|| m_type == Type::Rem
|| m_type == Type::Vh
|| m_type == Type::Vw