From cb9118efe34c9de618d60e879e9037cc8a84e8a8 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 13 Jan 2024 20:12:21 +1300 Subject: [PATCH] LibWeb: Use cached Element::id in HTMLFormControlsCollection --- .../Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp index afac7db0c6..6faa61899a 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp @@ -48,7 +48,7 @@ Variant> HTMLFormControlsCollection:: auto collection = collect_matching_elements(); for (auto const& element : collection) { - if (element->deprecated_attribute(HTML::AttributeNames::id) != deprecated_name && element->name() != deprecated_name) + if (element->id() != name && element->name() != deprecated_name) continue; if (matching_element) { @@ -68,12 +68,12 @@ Variant> HTMLFormControlsCollection:: // 4. Otherwise, create a new RadioNodeList object representing a live view of the HTMLFormControlsCollection object, further filtered so that the only nodes in the // RadioNodeList object are those that have either an id attribute or a name attribute equal to name. The nodes in the RadioNodeList object must be sorted in tree // order. Return that RadioNodeList object. - return JS::make_handle(RadioNodeList::create(realm(), root(), LiveNodeList::Scope::Descendants, [deprecated_name](Node const& node) { + return JS::make_handle(RadioNodeList::create(realm(), root(), LiveNodeList::Scope::Descendants, [name, deprecated_name](Node const& node) { if (!is(node)) return false; auto const& element = verify_cast(node); - return element.deprecated_attribute(HTML::AttributeNames::id) == deprecated_name || element.name() == deprecated_name; + return element.id() == name || element.name() == deprecated_name; })); }