mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Allocate dataset lazily for HTML/SVG/MathML elements
Most elements never need a dataset object, so we can avoid creating lots of objects by making them lazy.
This commit is contained in:
@@ -23,8 +23,13 @@ void MathMLElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(MathMLElement);
|
||||
}
|
||||
|
||||
m_dataset = HTML::DOMStringMap::create(*this);
|
||||
JS::NonnullGCPtr<HTML::DOMStringMap> MathMLElement::dataset()
|
||||
{
|
||||
if (!m_dataset)
|
||||
m_dataset = HTML::DOMStringMap::create(*this);
|
||||
return *m_dataset;
|
||||
}
|
||||
|
||||
Optional<ARIA::Role> MathMLElement::default_role() const
|
||||
|
||||
Reference in New Issue
Block a user