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:
Andreas Kling 2024-04-24 14:56:26 +02:00
commit 4c921e17b7
Notes: sideshowbarker 2024-07-17 06:51:10 +09:00
6 changed files with 23 additions and 11 deletions

View file

@ -23,8 +23,7 @@ public:
virtual void inserted() override;
virtual void removed_from(Node*) override;
HTML::DOMStringMap* dataset() { return m_dataset.ptr(); }
HTML::DOMStringMap const* dataset() const { return m_dataset.ptr(); }
[[nodiscard]] JS::NonnullGCPtr<HTML::DOMStringMap> dataset();
void focus();
void blur();