mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibWeb: Create Element::attributes (NamedNodeMap) lazily
Many elements have zero attributes, and they don't need a NamedNodeMap until someone asks for it.
This commit is contained in:
parent
5085b0dd66
commit
94cc4adefd
Notes:
github-actions[bot]
2025-04-20 16:44:29 +00:00
Author: https://github.com/awesomekling
Commit: 94cc4adefd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4408
3 changed files with 53 additions and 16 deletions
|
@ -154,7 +154,10 @@ public:
|
|||
|
||||
WebIDL::ExceptionOr<bool> toggle_attribute(FlyString const& name, Optional<bool> force);
|
||||
size_t attribute_list_size() const;
|
||||
NamedNodeMap const* attributes() const { return m_attributes.ptr(); }
|
||||
|
||||
GC::Ptr<NamedNodeMap const> attributes() const;
|
||||
GC::Ptr<NamedNodeMap> attributes();
|
||||
|
||||
Vector<String> get_attribute_names() const;
|
||||
|
||||
GC::Ptr<Attr> get_attribute_node(FlyString const& name) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue