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

LibWeb: Convert background-size from Length to LengthPercentage

Checking these for `auto` is awkward, but separating that will come
later. :^)
This commit is contained in:
Sam Atkins 2022-01-16 20:24:35 +00:00 committed by Andreas Kling
parent f75e796909
commit f602249ae9
4 changed files with 46 additions and 21 deletions

View file

@ -499,14 +499,14 @@ private:
// NOTE: This is not used for identifier sizes, like `cover` and `contain`.
class BackgroundSizeStyleValue final : public StyleValue {
public:
static NonnullRefPtr<BackgroundSizeStyleValue> create(Length size_x, Length size_y)
static NonnullRefPtr<BackgroundSizeStyleValue> create(LengthPercentage size_x, LengthPercentage size_y)
{
return adopt_ref(*new BackgroundSizeStyleValue(size_x, size_y));
}
virtual ~BackgroundSizeStyleValue() override { }
Length size_x() const { return m_size_x; }
Length size_y() const { return m_size_y; }
LengthPercentage size_x() const { return m_size_x; }
LengthPercentage size_y() const { return m_size_y; }
virtual String to_string() const override
{
@ -514,15 +514,15 @@ public:
}
private:
BackgroundSizeStyleValue(Length size_x, Length size_y)
BackgroundSizeStyleValue(LengthPercentage size_x, LengthPercentage size_y)
: StyleValue(Type::BackgroundSize)
, m_size_x(size_x)
, m_size_y(size_y)
{
}
Length m_size_x;
Length m_size_y;
LengthPercentage m_size_x;
LengthPercentage m_size_y;
};
class BorderStyleValue final : public StyleValue {