1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 07:04:59 +00:00

LibWeb: Port HTMLButtonElement interface from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-09-03 15:29:34 +12:00 committed by Tim Flynn
parent 2ab7129595
commit 57d8b0ec73
3 changed files with 7 additions and 7 deletions

View file

@ -57,18 +57,18 @@ void HTMLButtonElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLButtonElementPrototype>(realm, "HTMLButtonElement"));
}
DeprecatedString HTMLButtonElement::type() const
StringView HTMLButtonElement::type() const
{
auto value = deprecated_attribute(HTML::AttributeNames::type);
#define __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(keyword, _) \
if (value.equals_ignoring_ascii_case(#keyword##sv)) \
return #keyword;
return #keyword##sv;
ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTES
#undef __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE
// The missing value default and invalid value default are the Submit Button state.
return "submit";
return "submit"sv;
}
HTMLButtonElement::TypeAttributeState HTMLButtonElement::type_state() const
@ -85,7 +85,7 @@ HTMLButtonElement::TypeAttributeState HTMLButtonElement::type_state() const
return HTMLButtonElement::TypeAttributeState::Submit;
}
WebIDL::ExceptionOr<void> HTMLButtonElement::set_type(DeprecatedString const& type)
WebIDL::ExceptionOr<void> HTMLButtonElement::set_type(String const& type)
{
return set_attribute(HTML::AttributeNames::type, type);
}