LibWeb: Let supported_property_names() return Vector<FlyString>

Ultimately, this API should probably be replaced with something that
updates a cache on relevant DOM mutations instead of regenerating
the list of property names again and again.
This commit is contained in:
Andreas Kling 2023-12-24 20:59:00 +01:00
parent 0178929387
commit 41f56b0df9
Notes: sideshowbarker 2024-07-17 07:06:47 +09:00
19 changed files with 42 additions and 48 deletions

View file

@ -99,10 +99,10 @@ Element* HTMLCollection::named_item(FlyString const& name_) const
}
// https://dom.spec.whatwg.org/#ref-for-dfn-supported-property-names
Vector<String> HTMLCollection::supported_property_names() const
Vector<FlyString> HTMLCollection::supported_property_names() const
{
// 1. Let result be an empty list.
Vector<String> result;
Vector<FlyString> result;
// 2. For each element represented by the collection, in tree order:
auto elements = collect_matching_elements();
@ -119,7 +119,7 @@ Vector<String> HTMLCollection::supported_property_names() const
if (auto maybe_name = element->attribute(HTML::AttributeNames::name); maybe_name.has_value()) {
auto name = maybe_name.release_value();
if (!name.is_empty() && !result.contains_slow(name))
result.append(move(name));
result.append(name);
}
}
}