/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::CSS { // https://drafts.css-houdini.org/css-typed-om-1/#cssstylevalue class CSSStyleValue : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(CSSStyleValue, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(CSSStyleValue); public: [[nodiscard]] static GC::Ref create(JS::Realm&, String associated_property, String constructed_from_string); virtual ~CSSStyleValue() override = default; virtual void initialize(JS::Realm&) override; static WebIDL::ExceptionOr> parse(JS::VM&, String property, String css_text); static WebIDL::ExceptionOr>> parse_all(JS::VM&, String property, String css_text); virtual String to_string() const; protected: explicit CSSStyleValue(JS::Realm&); private: explicit CSSStyleValue(JS::Realm&, String associated_property, String constructed_from_string); enum class ParseMultiple : u8 { No, Yes, }; static WebIDL::ExceptionOr, GC::RootVector>>> parse_a_css_style_value(JS::VM&, String property, String css_text, ParseMultiple); // https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-associatedproperty-slot Optional m_associated_property; Optional m_constructed_from_string; }; }