/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #include "CSSStyleValue.h" #include #include #include namespace Web::CSS { GC_DEFINE_ALLOCATOR(CSSStyleValue); GC::Ref CSSStyleValue::create(JS::Realm& realm, String associated_property, String constructed_from_string) { return realm.create(realm, move(associated_property), move(constructed_from_string)); } CSSStyleValue::CSSStyleValue(JS::Realm& realm, String associated_property, String constructed_from_string) : PlatformObject(realm) , m_associated_property(move(associated_property)) , m_constructed_from_string(move(constructed_from_string)) { } void CSSStyleValue::initialize(JS::Realm& realm) { WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSStyleValue); Base::initialize(realm); } // https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-serialization String CSSStyleValue::to_string() const { // if the value was constructed from a USVString if (m_constructed_from_string.has_value()) { // the serialization is the USVString from which the value was constructed. return m_constructed_from_string.value(); } // FIXME: otherwise, if the value was constructed using an IDL constructor { // the serialization is specified in the sections below. } // FIXME: otherwise, if the value was extracted from the CSSOM { // the serialization is specified in ยง6.7 Serialization from CSSOM Values below. } return {}; } }