mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
LibWeb: Make LiveNodeList faster when it only cares about children
Same optimization as HTMLCollection, ported to LiveNodeList.
This commit is contained in:
parent
fe92b54137
commit
fa25f70086
3 changed files with 27 additions and 13 deletions
|
@ -932,8 +932,8 @@ Element* Node::parent_or_shadow_host_element()
|
|||
JS::NonnullGCPtr<NodeList> Node::child_nodes()
|
||||
{
|
||||
if (!m_child_nodes) {
|
||||
m_child_nodes = LiveNodeList::create(realm(), *this, [this](auto& node) {
|
||||
return is_parent_of(node);
|
||||
m_child_nodes = LiveNodeList::create(realm(), *this, LiveNodeList::Scope::Children, [](auto&) {
|
||||
return true;
|
||||
}).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
return *m_child_nodes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue