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

LibHTML: Finish the block width calculation

Also add horizontal box values to the layout tree dump.
This commit is contained in:
Andreas Kling 2019-08-18 08:09:56 +02:00
parent 587ddc5126
commit 70eca3b500
4 changed files with 78 additions and 15 deletions

View file

@ -40,3 +40,8 @@ private:
Type m_type { Type::Auto };
int m_value { 0 };
};
inline const LogStream& operator<<(const LogStream& stream, const Length& value)
{
return stream << value.to_string();
}

View file

@ -26,6 +26,8 @@ public:
virtual String to_string() const = 0;
virtual Length to_length() const { return {}; }
virtual bool is_auto() const { return false; }
protected:
explicit StyleValue(Type);
@ -66,6 +68,8 @@ public:
const Length& length() const { return m_length; }
virtual bool is_auto() const override { return m_length.is_auto(); }
private:
explicit LengthStyleValue(const Length& length)
: StyleValue(Type::Length)