diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-03 18:49:56 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-06 00:27:09 +0200 |
commit | 05dcf3b2f8138effa39c02e2d3dfe23be7c06d8b (patch) | |
tree | 3864ed47b364aea90d1d41d019748a51db7fa78c /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | |
parent | b30e95eb27bfe6849590600f7f674129a5ada5e6 (diff) | |
download | serenity-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.cpp | 7 |
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); |