LibWeb: Use correct IDL for HTTPFormElement's method attribute

Removed the custom getter and updated the idl so that the attribute
is Reflected and Enumerated.
This commit is contained in:
samu698 2024-10-20 18:24:24 +02:00 committed by Andrew Kaster
parent ebe89a3207
commit 6892482755
Notes: github-actions[bot] 2024-10-21 21:42:12 +00:00
5 changed files with 83 additions and 19 deletions

View file

@ -565,23 +565,6 @@ Vector<JS::NonnullGCPtr<DOM::Element>> HTMLFormElement::get_submittable_elements
return submittable_elements;
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-fs-method
StringView HTMLFormElement::method() const
{
// The method and enctype IDL attributes must reflect the respective content attributes of the same name, limited to only known values.
// FIXME: This should probably be `Reflect` in the IDL.
auto method_state = method_state_from_form_element(*this);
switch (method_state) {
case MethodAttributeState::GET:
return "get"sv;
case MethodAttributeState::POST:
return "post"sv;
case MethodAttributeState::Dialog:
return "dialog"sv;
}
VERIFY_NOT_REACHED();
}
// https://html.spec.whatwg.org/multipage/forms.html#dom-form-rellist
JS::NonnullGCPtr<DOM::DOMTokenList> HTMLFormElement::rel_list()
{