/* * Copyright (c) 2024, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { class ScaleStyleValue : public StyleValueWithDefaultOperators { public: static ValueComparingNonnullRefPtr create(NumberPercentage x, NumberPercentage y) { return adopt_ref(*new (nothrow) ScaleStyleValue(move(x), move(y))); } virtual ~ScaleStyleValue() override = default; NumberPercentage const& x() const { return m_properties.x; } NumberPercentage const& y() const { return m_properties.y; } virtual String to_string(SerializationMode) const override; bool properties_equal(ScaleStyleValue const& other) const { return m_properties == other.m_properties; } private: explicit ScaleStyleValue( NumberPercentage x, NumberPercentage y) : StyleValueWithDefaultOperators(Type::Scale) , m_properties { .x = move(x), .y = move(y), } { } struct Properties { NumberPercentage x; NumberPercentage y; bool operator==(Properties const&) const = default; } m_properties; }; }