mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb: Cache name->element mappings in HTMLCollection
This makes https://wpt.fyi/ load today instead of tomorrow, although there's a lot of room for improvement still.
This commit is contained in:
parent
132ab775d8
commit
4d78c66b3d
Notes:
github-actions[bot]
2024-07-25 11:12:56 +00:00
Author: https://github.com/awesomekling
Commit: 4d78c66b3d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/823
Reviewed-by: https://github.com/shannonbooth
4 changed files with 48 additions and 31 deletions
|
@ -47,9 +47,7 @@ JS::ThrowCompletionOr<bool> PlatformObject::is_named_property_exposed_on_object(
|
|||
|
||||
// 1. If P is not a supported property name of O, then return false.
|
||||
// NOTE: This is in it's own variable to enforce the type.
|
||||
auto supported_property_names = this->supported_property_names();
|
||||
auto property_key_string = MUST(String::from_byte_string(property_key.to_string()));
|
||||
if (!supported_property_names.contains_slow(property_key_string))
|
||||
if (!is_supported_property_name(MUST(String::from_byte_string(property_key.to_string()))))
|
||||
return false;
|
||||
|
||||
// 2. If O has an own property named P, then return false.
|
||||
|
@ -500,6 +498,11 @@ Vector<FlyString> PlatformObject::supported_property_names() const
|
|||
return {};
|
||||
}
|
||||
|
||||
bool PlatformObject::is_supported_property_name(FlyString const& name) const
|
||||
{
|
||||
return supported_property_names().contains_slow(name);
|
||||
}
|
||||
|
||||
bool PlatformObject::is_supported_property_index(u32) const
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue