/* * Copyright (c) 2025, Callum Law * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { class RandomValueSharingStyleValue : public StyleValueWithDefaultOperators { public: static ValueComparingNonnullRefPtr create_fixed(NonnullRefPtr const& fixed_value) { return adopt_ref(*new (nothrow) RandomValueSharingStyleValue(fixed_value)); } virtual ~RandomValueSharingStyleValue() override = default; virtual ValueComparingNonnullRefPtr absolutized(ComputationContext const&) const override; double random_base_value() const; virtual String to_string(SerializationMode serialization_mode) const override; bool properties_equal(RandomValueSharingStyleValue const& other) const { return m_fixed_value == other.m_fixed_value; } private: explicit RandomValueSharingStyleValue(RefPtr fixed_value) : StyleValueWithDefaultOperators(Type::RandomValueSharing) , m_fixed_value(move(fixed_value)) { } ValueComparingRefPtr m_fixed_value; }; }