mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Split OverflowStyleValue out of StyleValue.{h,cpp}
This commit is contained in:
parent
7f6add1c6e
commit
f98634586e
7 changed files with 68 additions and 34 deletions
|
@ -627,35 +627,6 @@ private:
|
|||
NonnullOwnPtr<CalcSum> m_expression;
|
||||
};
|
||||
|
||||
class OverflowStyleValue final : public StyleValueWithDefaultOperators<OverflowStyleValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<OverflowStyleValue> create(ValueComparingNonnullRefPtr<StyleValue> overflow_x, ValueComparingNonnullRefPtr<StyleValue> overflow_y)
|
||||
{
|
||||
return adopt_ref(*new OverflowStyleValue(move(overflow_x), move(overflow_y)));
|
||||
}
|
||||
virtual ~OverflowStyleValue() override = default;
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue> overflow_x() const { return m_properties.overflow_x; }
|
||||
ValueComparingNonnullRefPtr<StyleValue> overflow_y() const { return m_properties.overflow_y; }
|
||||
|
||||
virtual ErrorOr<String> to_string() const override;
|
||||
|
||||
bool properties_equal(OverflowStyleValue const& other) const { return m_properties == other.m_properties; }
|
||||
|
||||
private:
|
||||
OverflowStyleValue(ValueComparingNonnullRefPtr<StyleValue> overflow_x, ValueComparingNonnullRefPtr<StyleValue> overflow_y)
|
||||
: StyleValueWithDefaultOperators(Type::Overflow)
|
||||
, m_properties { .overflow_x = move(overflow_x), .overflow_y = move(overflow_y) }
|
||||
{
|
||||
}
|
||||
|
||||
struct Properties {
|
||||
ValueComparingNonnullRefPtr<StyleValue> overflow_x;
|
||||
ValueComparingNonnullRefPtr<StyleValue> overflow_y;
|
||||
bool operator==(Properties const&) const = default;
|
||||
} m_properties;
|
||||
};
|
||||
|
||||
class PercentageStyleValue final : public StyleValueWithDefaultOperators<PercentageStyleValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<PercentageStyleValue> create(Percentage percentage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue