/* * Copyright (c) 2024, the Ladybird developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::HTML { // https://html.spec.whatwg.org/multipage/custom-elements.html#elementinternals class ElementInternals final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(ElementInternals, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(ElementInternals); public: static GC::Ref create(JS::Realm&, HTMLElement& target_element); GC::Ptr shadow_root() const; private: explicit ElementInternals(JS::Realm&, HTMLElement& target_element); virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor& visitor) override; // https://html.spec.whatwg.org/multipage/custom-elements.html#internals-target GC::Ref m_target_element; }; }