1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

LibHTML: A tiny bit of work towards block layout.

This commit is contained in:
Andreas Kling 2019-07-26 08:05:14 +02:00
parent fc9a1a1328
commit e423bb4901
2 changed files with 21 additions and 1 deletions

View file

@ -24,6 +24,7 @@ public:
bool is_initial() const { return type() == Type::Initial; }
virtual String to_string() const = 0;
virtual Length to_length() const { return {}; }
protected:
explicit StyleValue(Type);
@ -60,7 +61,10 @@ public:
}
virtual ~LengthStyleValue() override {}
String to_string() const override { return m_length.to_string(); }
virtual String to_string() const override { return m_length.to_string(); }
virtual Length to_length() const override { return m_length; }
const Length& length() const { return m_length; }
private:
explicit LengthStyleValue(const Length& length)