/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { using CSSUnparsedSegment = Variant>; using GCRootCSSUnparsedSegment = Variant>; // https://drafts.css-houdini.org/css-typed-om-1/#cssunparsedvalue class CSSUnparsedValue : public CSSStyleValue { WEB_PLATFORM_OBJECT(CSSUnparsedValue, CSSStyleValue); GC_DECLARE_ALLOCATOR(CSSUnparsedValue); public: [[nodiscard]] static GC::Ref create(JS::Realm&, Vector); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, Vector); virtual ~CSSUnparsedValue() override; WebIDL::UnsignedLong length() const; virtual Optional item_value(size_t index) const override; virtual WebIDL::ExceptionOr set_value_of_existing_indexed_property(u32, JS::Value) override; virtual WebIDL::ExceptionOr set_value_of_new_indexed_property(u32, JS::Value) override; virtual String to_string() const override; private: explicit CSSUnparsedValue(JS::Realm&, Vector); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; // https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-tokens-slot // They have a [[tokens]] internal slot, which is a list of USVStrings and CSSVariableReferenceValue objects. // This list is the object’s values to iterate over. Vector m_tokens; }; }