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

LibWeb: Remove default Length constructor and add make_auto()/make_px()

To prepare for adding an undefined/empty state for Length, let's first
move away from Length() creating an auto value.
This commit is contained in:
Andreas Kling 2020-06-24 11:08:46 +02:00
parent 26eef65017
commit 5744dd43c5
7 changed files with 60 additions and 58 deletions

View file

@ -40,7 +40,6 @@ public:
Rem,
};
Length() { }
Length(int value, Type type)
: m_type(type)
, m_value(value)
@ -52,6 +51,9 @@ public:
{
}
static Length make_auto() { return Length(0, Type::Auto); }
static Length make_px(float value) { return Length(value, Type::Px); }
bool is_auto() const { return m_type == Type::Auto; }
bool is_absolute() const { return m_type == Type::Px; }
bool is_relative() const { return m_type == Type::Em || m_type == Type::Rem; }