mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Don't allocate DOMStringMap in HTMLElement constructor
Allocations go in initialize().
This commit is contained in:
parent
b30e95eb27
commit
05dcf3b2f8
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/awesomekling
Commit: 05dcf3b2f8
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue