/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::HTML { // https://html.spec.whatwg.org/multipage/custom-elements.html#customstateset class CustomStateSet final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(CustomStateSet, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(CustomStateSet); public: [[nodiscard]] static GC::Ref create(JS::Realm&, GC::Ref); virtual ~CustomStateSet() override = default; GC::Ref set_entries() const { return m_set_entries; } bool has_state(FlyString const&) const; void on_set_modified_from_js(Badge); private: CustomStateSet(JS::Realm&, GC::Ref); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; GC::Ref m_set_entries; GC::Ref m_element; }; }