LibWeb/HTML: Update HTMLButtonElement.type to match spec changes

Corresponds to part of https://github.com/whatwg/html/pull/9841 and then
https://github.com/whatwg/html/pull/11047

Adding `Auto` as a type state feels a little odd, as it's not an actual
type allowed in HTML. However, it's the default state when the value is
missing or invalid, which works out the same, as long as we never
serialize "auto", which we don't.
This commit is contained in:
Sam Atkins
2025-02-20 17:01:28 +00:00
committed by Tim Ledbetter
parent 03bccb5ff1
commit ff1ef07160
6 changed files with 149 additions and 9 deletions

View File

@@ -16,7 +16,8 @@ namespace Web::HTML {
#define ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTES \
__ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(submit, Submit) \
__ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(reset, Reset) \
__ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(button, Button)
__ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(button, Button) \
__ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(auto, Auto)
class HTMLButtonElement final
: public HTMLElement
@@ -38,7 +39,8 @@ public:
};
TypeAttributeState type_state() const;
WebIDL::ExceptionOr<void> set_type(String const&);
String type_for_bindings() const;
WebIDL::ExceptionOr<void> set_type_for_bindings(String const&);
virtual void form_associated_element_attribute_changed(FlyString const& name, Optional<String> const& value, Optional<FlyString> const& namespace_) override;