/* * Copyright (c) 2026, Callum Law * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::CSS { class BorderRadiusRectStyleValue final : public StyleValueWithDefaultOperators { public: static ValueComparingNonnullRefPtr create_zero() { return create(BorderRadiusStyleValue::create_zero(), BorderRadiusStyleValue::create_zero(), BorderRadiusStyleValue::create_zero(), BorderRadiusStyleValue::create_zero()); } static ValueComparingNonnullRefPtr create(NonnullRefPtr top_left, NonnullRefPtr top_right, NonnullRefPtr bottom_right, NonnullRefPtr bottom_left) { return adopt_ref(*new (nothrow) BorderRadiusRectStyleValue(move(top_left), move(top_right), move(bottom_right), move(bottom_left))); } virtual ~BorderRadiusRectStyleValue() override = default; virtual void serialize(StringBuilder&, SerializationMode) const override; virtual ValueComparingNonnullRefPtr absolutized(ComputationContext const&) const override; NonnullRefPtr top_left() const { return m_top_left; } NonnullRefPtr top_right() const { return m_top_right; } NonnullRefPtr bottom_right() const { return m_bottom_right; } NonnullRefPtr bottom_left() const { return m_bottom_left; } bool properties_equal(BorderRadiusRectStyleValue const& other) const { return m_top_left == other.m_top_left && m_top_right == other.m_top_right && m_bottom_right == other.m_bottom_right && m_bottom_left == other.m_bottom_left; } virtual bool is_computationally_independent() const override { return m_top_left->is_computationally_independent() && m_top_right->is_computationally_independent() && m_bottom_right->is_computationally_independent() && m_bottom_left->is_computationally_independent(); } private: BorderRadiusRectStyleValue(NonnullRefPtr top_left, NonnullRefPtr top_right, NonnullRefPtr bottom_right, NonnullRefPtr bottom_left) : StyleValueWithDefaultOperators(Type::BorderRadiusRect) , m_top_left(move(top_left)) , m_top_right(move(top_right)) , m_bottom_right(move(bottom_right)) , m_bottom_left(move(bottom_left)) { } ValueComparingNonnullRefPtr m_top_left; ValueComparingNonnullRefPtr m_top_right; ValueComparingNonnullRefPtr m_bottom_right; ValueComparingNonnullRefPtr m_bottom_left; }; }