/* * Copyright (c) 2023, MacDue * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::CSS { class EdgeStyleValue final : public StyleValueWithDefaultOperators { public: static ValueComparingNonnullRefPtr create(PositionEdge edge, LengthPercentage const& offset) { return adopt_ref(*new EdgeStyleValue(edge, offset)); } virtual ~EdgeStyleValue() override = default; PositionEdge edge() const { return m_properties.edge; } LengthPercentage const& offset() const { return m_properties.offset; } virtual ErrorOr to_string() const override; bool properties_equal(EdgeStyleValue const& other) const { return m_properties == other.m_properties; } private: EdgeStyleValue(PositionEdge edge, LengthPercentage const& offset) : StyleValueWithDefaultOperators(Type::Edge) , m_properties { .edge = edge, .offset = offset } { } struct Properties { PositionEdge edge; LengthPercentage offset; bool operator==(Properties const&) const = default; } m_properties; }; }