ladybird/Libraries/LibWeb/CSS/StylePropertyMap.h
Andreas Kling 96521f7df0 LibWeb: Take UTF-16 names in Typed OM property maps
Move StylePropertyMap, StylePropertyMapReadOnly, and the CSS.supports
property-name overload to Utf16FlyString. Request the UTF-16 binding
conversion path for their IDL property-name arguments.
2026-06-09 11:48:02 +02:00

36 lines
1.1 KiB
C++

/*
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/StylePropertyMapReadOnly.h>
namespace Web::CSS {
// https://drafts.css-houdini.org/css-typed-om-1/#stylepropertymap
class StylePropertyMap : public StylePropertyMapReadOnly {
WEB_PLATFORM_OBJECT(StylePropertyMap, StylePropertyMapReadOnly);
GC_DECLARE_ALLOCATOR(StylePropertyMap);
public:
[[nodiscard]] static GC::Ref<StylePropertyMap> create(JS::Realm&, GC::Ref<CSSStyleDeclaration>);
virtual ~StylePropertyMap() override;
WebIDL::ExceptionOr<void> set(Utf16FlyString property, ReadonlySpan<Variant<GC::Ref<CSSStyleValue>, String>> values);
WebIDL::ExceptionOr<void> append(Utf16FlyString property, ReadonlySpan<Variant<GC::Ref<CSSStyleValue>, String>> values);
WebIDL::ExceptionOr<void> delete_(Utf16FlyString property);
WebIDL::ExceptionOr<void> clear();
private:
explicit StylePropertyMap(JS::Realm&, GC::Ref<CSSStyleDeclaration>);
CSSStyleDeclaration& declarations();
virtual void initialize(JS::Realm&) override;
};
}