1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:25:08 +00:00

LibWeb: Bring form submission more up to spec

The main missing things are:
- Dialog submission
- Form validation
- Encoding URLs in the form element's encoding
- Navigables
This commit is contained in:
Luke Wilde 2023-06-18 16:30:23 +01:00 committed by Andreas Kling
parent bd62fe9c33
commit f04d1d493d
6 changed files with 668 additions and 73 deletions

View file

@ -244,7 +244,7 @@ WebIDL::ExceptionOr<void> HTMLInputElement::show_picker()
}
// https://html.spec.whatwg.org/multipage/input.html#input-activation-behavior
ErrorOr<void> HTMLInputElement::run_input_activation_behavior()
WebIDL::ExceptionOr<void> HTMLInputElement::run_input_activation_behavior()
{
if (type_state() == TypeAttributeState::Checkbox || type_state() == TypeAttributeState::RadioButton) {
// 1. If the element is not connected, then return.
@ -272,7 +272,7 @@ ErrorOr<void> HTMLInputElement::run_input_activation_behavior()
return {};
// 3. Submit the form owner from the element.
TRY(form->submit_form(this));
TRY(form->submit_form(*this));
} else if (type_state() == TypeAttributeState::FileUpload) {
show_the_picker_if_applicable(*this);
} else {