mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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:
parent
1560d6ad62
commit
4c921e17b7
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/awesomekling
Commit: 4c921e17b7
Pull-request: https://github.com/SerenityOS/serenity/pull/24100
6 changed files with 23 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue