mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibWeb: Implement is_supported_property_index in terms of length()
This commit is contained in:
parent
b9b264e97a
commit
b1be8bd826
Notes:
sideshowbarker
2024-07-17 00:47:29 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/b1be8bd826 Pull-request: https://github.com/SerenityOS/serenity/pull/23792 Reviewed-by: https://github.com/awesomekling
@ -150,8 +150,7 @@ bool HTMLCollection::is_supported_property_index(u32 index) const
|
||||
{
|
||||
// The object’s supported property indices are the numbers in the range zero to one less than the number of elements represented by the collection.
|
||||
// If there are no such elements, then there are no supported property indices.
|
||||
auto elements = collect_matching_elements();
|
||||
return index < elements.size();
|
||||
return index < length();
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> HTMLCollection::item_value(size_t index) const
|
||||
|
Loading…
Reference in New Issue
Block a user