mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Make HTMLCollection faster when it only cares about children
Some of the live HTMLCollection only ever contain children of their root node. When we know that's the case, we can avoid doing a full subtree traversal of all descendants and only visit children. This cuts the ECMA262 spec loading time by over 10 seconds. :^)
This commit is contained in:
parent
e31f696ee6
commit
df1bb0ff49
Notes:
sideshowbarker
2024-07-17 05:41:34 +09:00
Author: https://github.com/awesomekling
Commit: df1bb0ff49
Pull-request: https://github.com/SerenityOS/serenity/pull/18999
10 changed files with 54 additions and 41 deletions
|
@ -19,7 +19,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLOptionsCollection>> HTMLOptionsCollecti
|
|||
}
|
||||
|
||||
HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter)
|
||||
: DOM::HTMLCollection(root, move(filter))
|
||||
: DOM::HTMLCollection(root, Scope::Descendants, move(filter))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue