diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 3e276996ed..6b6a0a85c3 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -6,27 +6,33 @@ #include <AK/CharacterTypes.h> #include <LibWeb/Bindings/DOMStringMapPrototype.h> -#include <LibWeb/Bindings/WindowObject.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Element.h> #include <LibWeb/HTML/DOMStringMap.h> +#include <LibWeb/HTML/Window.h> namespace Web::HTML { -DOMStringMap* DOMStringMap::create(DOM::Element& element) +JS::NonnullGCPtr<DOMStringMap> DOMStringMap::create(DOM::Element& element) { - auto& realm = element.document().preferred_window_object().realm(); - return realm.heap().allocate<DOMStringMap>(realm, element); + auto& realm = element.document().window().realm(); + return *realm.heap().allocate<DOMStringMap>(realm, element); } DOMStringMap::DOMStringMap(DOM::Element& element) - : PlatformObject(element.document().preferred_window_object().ensure_web_prototype<Bindings::DOMStringMapPrototype>("DOMStringMap")) + : PlatformObject(element.document().window().ensure_web_prototype<Bindings::DOMStringMapPrototype>("DOMStringMap")) , m_associated_element(element) { } DOMStringMap::~DOMStringMap() = default; +void DOMStringMap::visit_edges(Cell::Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_associated_element.ptr()); +} + // https://html.spec.whatwg.org/multipage/dom.html#concept-domstringmap-pairs Vector<DOMStringMap::NameValuePair> DOMStringMap::get_name_value_pairs() const { |