/* * Copyright (c) 2025, Tim Ledbetter * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::CSS { class BorderImageSliceStyleValue final : public StyleValueWithDefaultOperators { public: static ValueComparingNonnullRefPtr create(ValueComparingNonnullRefPtr top, ValueComparingNonnullRefPtr right, ValueComparingNonnullRefPtr bottom, ValueComparingNonnullRefPtr left, bool fill) { return adopt_ref(*new (nothrow) BorderImageSliceStyleValue(top, right, bottom, left, fill)); } virtual ~BorderImageSliceStyleValue() override = default; ValueComparingNonnullRefPtr top() const { return m_properties.top; } ValueComparingNonnullRefPtr left() const { return m_properties.left; } ValueComparingNonnullRefPtr bottom() const { return m_properties.bottom; } ValueComparingNonnullRefPtr right() const { return m_properties.right; } bool fill() const { return m_properties.fill; } virtual String to_string(SerializationMode) const override; bool properties_equal(BorderImageSliceStyleValue const& other) const { return m_properties == other.m_properties; } private: BorderImageSliceStyleValue(ValueComparingNonnullRefPtr top, ValueComparingNonnullRefPtr right, ValueComparingNonnullRefPtr bottom, ValueComparingNonnullRefPtr left, bool fill) : StyleValueWithDefaultOperators(Type::BorderImageSlice) , m_properties { .top = move(top), .right = move(right), .bottom = move(bottom), .left = move(left), .fill = fill } { } struct Properties { ValueComparingNonnullRefPtr top; ValueComparingNonnullRefPtr right; ValueComparingNonnullRefPtr bottom; ValueComparingNonnullRefPtr left; bool fill; bool operator==(Properties const&) const = default; } m_properties; }; }