mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
LibWeb: Add support for viewport-relative length units (#3433)
We can now use vh, vw, vmax and vmin as length units in CSS.
This commit is contained in:
@@ -42,6 +42,10 @@ public:
|
||||
Ex,
|
||||
Em,
|
||||
Rem,
|
||||
Vh,
|
||||
Vw,
|
||||
Vmax,
|
||||
Vmin,
|
||||
};
|
||||
|
||||
Length() { }
|
||||
@@ -85,7 +89,16 @@ public:
|
||||
bool is_percentage() const { return m_type == Type::Percentage; }
|
||||
bool is_auto() const { return m_type == Type::Auto; }
|
||||
bool is_absolute() const { return m_type == Type::Px || m_type == Type::Pt; }
|
||||
bool is_relative() const { return m_type == Type::Ex || m_type == Type::Em || m_type == Type::Rem; }
|
||||
bool is_relative() const
|
||||
{
|
||||
return m_type == Type::Ex
|
||||
|| m_type == Type::Em
|
||||
|| m_type == Type::Rem
|
||||
|| m_type == Type::Vh
|
||||
|| m_type == Type::Vw
|
||||
|| m_type == Type::Vmax
|
||||
|| m_type == Type::Vmin;
|
||||
}
|
||||
|
||||
float raw_value() const { return m_value; }
|
||||
ALWAYS_INLINE float to_px(const LayoutNode& layout_node) const
|
||||
|
||||
Reference in New Issue
Block a user