LibWeb: Add cm, in, mm and Q CSS units

This commit is contained in:
Luke 2020-09-29 19:06:58 +01:00 committed by Andreas Kling
commit a9335eea1c
Notes: sideshowbarker 2024-07-19 02:07:39 +09:00
3 changed files with 45 additions and 3 deletions

View file

@ -62,10 +62,18 @@ float Length::relative_length_to_px(const LayoutNode& layout_node) const
const char* Length::unit_name() const
{
switch (m_type) {
case Type::Cm:
return "cm";
case Type::In:
return "in";
case Type::Px:
return "px";
case Type::Pt:
return "pt";
case Type::Mm:
return "mm";
case Type::Q:
return "Q";
case Type::Ex:
return "ex";
case Type::Em: