1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibWeb: Make LiveNodeList faster when it only cares about children

Same optimization as HTMLCollection, ported to LiveNodeList.
This commit is contained in:
Andreas Kling 2023-05-23 12:28:16 +02:00
parent fe92b54137
commit fa25f70086
3 changed files with 27 additions and 13 deletions

View file

@ -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;