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

LibWeb: Split AngleStyleValue out of StyleValue.{h,cpp}

This commit is contained in:
Sam Atkins 2023-03-23 17:26:13 +00:00 committed by Linus Groh
parent 36c5afdfb2
commit 777d3e73f9
7 changed files with 74 additions and 25 deletions

View file

@ -502,30 +502,6 @@ struct StyleValueWithDefaultOperators : public StyleValue {
}
};
class AngleStyleValue : public StyleValueWithDefaultOperators<AngleStyleValue> {
public:
static ValueComparingNonnullRefPtr<AngleStyleValue> create(Angle angle)
{
return adopt_ref(*new AngleStyleValue(move(angle)));
}
virtual ~AngleStyleValue() override { }
Angle const& angle() const { return m_angle; }
virtual ErrorOr<String> to_string() const override { return m_angle.to_string(); }
bool properties_equal(AngleStyleValue const& other) const { return m_angle == other.m_angle; }
private:
explicit AngleStyleValue(Angle angle)
: StyleValueWithDefaultOperators(Type::Angle)
, m_angle(move(angle))
{
}
Angle m_angle;
};
class BackgroundStyleValue final : public StyleValueWithDefaultOperators<BackgroundStyleValue> {
public:
static ValueComparingNonnullRefPtr<BackgroundStyleValue> create(