mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-15 04:29:27 +00:00
The bindings are able to give us FlyString, and that's the type we use for property names, so let's use that instead of String.
36 lines
1.1 KiB
C++
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(FlyString property, Vector<Variant<GC::Root<CSSStyleValue>, String>> values);
|
|
WebIDL::ExceptionOr<void> append(FlyString property, Vector<Variant<GC::Root<CSSStyleValue>, String>> values);
|
|
WebIDL::ExceptionOr<void> delete_(FlyString property);
|
|
WebIDL::ExceptionOr<void> clear();
|
|
|
|
private:
|
|
explicit StylePropertyMap(JS::Realm&, GC::Ref<CSSStyleDeclaration>);
|
|
|
|
CSSStyleDeclaration& declarations();
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
};
|
|
|
|
}
|