1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Port Element::name to a cached FlyString

Also removing some handling of OOM while we are in the area.
This commit is contained in:
Shannon Booth 2024-01-13 20:12:23 +13:00 committed by Andreas Kling
parent cb9118efe3
commit 41f84deb9f
6 changed files with 22 additions and 24 deletions

View file

@ -1252,9 +1252,8 @@ void Document::set_hovered_node(Node* node)
JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_name(String const& name)
{
auto deprecated_name = name.to_byte_string();
return HTMLCollection::create(*this, HTMLCollection::Scope::Descendants, [deprecated_name](Element const& element) {
return element.name() == deprecated_name;
return HTMLCollection::create(*this, HTMLCollection::Scope::Descendants, [name](Element const& element) {
return element.name() == name;
});
}