summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-03 18:49:56 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 00:27:09 +0200
commit05dcf3b2f8138effa39c02e2d3dfe23be7c06d8b (patch)
tree3864ed47b364aea90d1d41d019748a51db7fa78c /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
parentb30e95eb27bfe6849590600f7f674129a5ada5e6 (diff)
downloadserenity-05dcf3b2f8138effa39c02e2d3dfe23be7c06d8b.zip
LibWeb: Don't allocate DOMStringMap in HTMLElement constructor
Allocations go in initialize().
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index 05111ab5ef..587fbfd6ea 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -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);