/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::CSS { // https://drafts.css-houdini.org/css-typed-om-1/#stylepropertymapreadonly class StylePropertyMapReadOnly : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(StylePropertyMapReadOnly, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(StylePropertyMapReadOnly); public: [[nodiscard]] static GC::Ref create_computed_style(JS::Realm&, DOM::AbstractElement); virtual ~StylePropertyMapReadOnly() override; WebIDL::ExceptionOr, Empty>> get(String property); WebIDL::ExceptionOr>> get_all(String property); WebIDL::ExceptionOr has(String property); WebIDL::UnsignedLong size() const; protected: explicit StylePropertyMapReadOnly(JS::Realm&, GC::Ref); explicit StylePropertyMapReadOnly(JS::Realm&, Optional = {}); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; Optional m_source_element; GC::Ptr m_source_declaration; // https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-declarations-slot // A StylePropertyMapReadOnly object has a [[declarations]] internal slot, which is a map reflecting the CSS // declaration block’s declarations. HashMap> m_declarations; }; }