LibWeb: Implement is_supported_property_index in terms of length()

This commit is contained in:
Shannon Booth 2024-04-01 15:20:02 +02:00 committed by Andreas Kling
parent b9b264e97a
commit b1be8bd826
Notes: sideshowbarker 2024-07-17 00:47:29 +09:00

View File

@ -150,8 +150,7 @@ bool HTMLCollection::is_supported_property_index(u32 index) const
{
// The objects 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