1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 14:54:57 +00:00

LibWeb: Make DOMStringMap GC-allocated

This commit is contained in:
Andreas Kling 2022-08-08 14:49:54 +02:00
parent 72bacba97b
commit ae11d70b0c
8 changed files with 35 additions and 25 deletions

View file

@ -5,13 +5,23 @@
*/
#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>
namespace Web::HTML {
DOMStringMap::DOMStringMap(DOM::Element& associated_element)
: m_associated_element(associated_element)
DOMStringMap* DOMStringMap::create(DOM::Element& element)
{
auto& realm = element.document().preferred_window_object().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"))
, m_associated_element(element)
{
}