1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

LibWeb: Don't allocate DOMStringMap in HTMLElement constructor

Allocations go in initialize().
This commit is contained in:
Andreas Kling 2022-09-03 18:49:56 +02:00
parent b30e95eb27
commit 05dcf3b2f8
2 changed files with 9 additions and 2 deletions

View file

@ -30,13 +30,18 @@ namespace Web::HTML {
HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: Element(document, move(qualified_name))
, m_dataset(DOMStringMap::create(*this))
{
set_prototype(&window().cached_web_prototype("HTMLElement"));
}
HTMLElement::~HTMLElement() = default;
void HTMLElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
m_dataset = DOMStringMap::create(*this);
}
void HTMLElement::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);