mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
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:
parent
0178929387
commit
41f56b0df9
Notes:
sideshowbarker
2024-07-17 07:06:47 +09:00
Author: https://github.com/awesomekling
Commit: 41f56b0df9
Pull-request: https://github.com/SerenityOS/serenity/pull/22422
19 changed files with 42 additions and 48 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue