/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { // https://drafts.css-houdini.org/css-typed-om-1/#typedefdef-csskeywordish using CSSKeywordish = Variant>; // https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue class CSSKeywordValue final : public CSSStyleValue { WEB_PLATFORM_OBJECT(CSSKeywordValue, CSSStyleValue); GC_DECLARE_ALLOCATOR(CSSKeywordValue); public: [[nodiscard]] static GC::Ref create(JS::Realm&, FlyString value); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString value); virtual ~CSSKeywordValue() override = default; FlyString const& value() const { return m_value; } WebIDL::ExceptionOr set_value(FlyString value); virtual WebIDL::ExceptionOr to_string() const override; virtual WebIDL::ExceptionOr> create_an_internal_representation(PropertyNameAndID const&, PerformTypeCheck) const override; private: explicit CSSKeywordValue(JS::Realm&, FlyString value); virtual void initialize(JS::Realm&) override; FlyString m_value; }; GC::Ref rectify_a_keywordish_value(JS::Realm&, CSSKeywordish const&); }