mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 23:12:02 +00:00
LibWeb: Implement 'no-validate state' concept
This commit is contained in:
parent
edfae02680
commit
8ca956e6f1
Notes:
github-actions[bot]
2025-07-07 19:15:00 +00:00
Author: https://github.com/edvwib 🔰
Commit: 8ca956e6f1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4592
Reviewed-by: https://github.com/tcl3
7 changed files with 109 additions and 5 deletions
|
@ -139,11 +139,20 @@ WebIDL::ExceptionOr<void> HTMLFormElement::submit_form(GC::Ref<HTMLElement> subm
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: 4. If the submitter element's no-validate state is false, then interactively validate the constraints
|
||||
// of form and examine the result. If the result is negative (i.e., the constraint validation concluded
|
||||
// that there were invalid fields and probably informed the user of this), then:
|
||||
// 1. Set form's firing submission events to false.
|
||||
// 2. Return.
|
||||
// 4. If the submitter element's no-validate state is false, then interactively validate the constraints
|
||||
// of form and examine the result. If the result is negative (i.e., the constraint validation concluded
|
||||
// that there were invalid fields and probably informed the user of this), then:
|
||||
auto* form_associated_element = as_if<FormAssociatedElement>(*submitter);
|
||||
if (form_associated_element && !form_associated_element->novalidate_state()) {
|
||||
auto validation_result = interactively_validate_constraints();
|
||||
if (!validation_result) {
|
||||
// 1. Set form's firing submission events to false.
|
||||
m_firing_submission_events = false;
|
||||
|
||||
// 2. Return.
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Let submitterButton be null if submitter is form. Otherwise, let submitterButton be submitter.
|
||||
GC::Ptr<HTMLElement> submitter_button;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue