From 5d47ba1e38fd22b15ab4e6e15a5f865bb02b53d6 Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Wed, 4 Dec 2024 19:06:47 +0900 Subject: [PATCH] LibWeb: Minor code cleanup; use HTML::AttributeNames::value, not string This is a minor change to the Node::name_or_description code to switch some instances of element.has_attribute("value"_string) over to instead using element.has_attribute(HTML::AttributeNames::value). --- Libraries/LibWeb/DOM/Node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 2d4bc9540dc..6fc5a3f7bb6 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -2343,7 +2343,7 @@ ErrorOr Node::name_or_description(NameOrDescription target, Document con // i. Textbox: If the embedded control has role textbox, return its value. if (is(*node)) { auto const& element = static_cast(*node); - if (element.has_attribute("value"_string)) + if (element.has_attribute(HTML::AttributeNames::value)) builder.append(element.value()); } else builder.append(node->text_content().value()); @@ -2351,7 +2351,7 @@ ErrorOr Node::name_or_description(NameOrDescription target, Document con // ii. Combobox/Listbox: If the embedded control has role combobox or listbox, return the text alternative of the chosen option. if (is(*node)) { auto const& element = static_cast(*node); - if (element.has_attribute("value"_string)) + if (element.has_attribute(HTML::AttributeNames::value)) builder.append(element.value()); } else if (is(*node)) { auto const& element = static_cast(*node); @@ -2384,7 +2384,7 @@ ErrorOr Node::name_or_description(NameOrDescription target, Document con // c. Otherwise, use the value as specified by a host language attribute. else if (is(*node)) { auto const& element = static_cast(*node); - if (element.has_attribute("value"_string)) + if (element.has_attribute(HTML::AttributeNames::value)) builder.append(element.value()); } }