mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 12:17:52 +00:00
LibWeb: Correct typos for user validity of form elements on submission
The spec and comments say "set field's user validity to true", but we now actually set it to true and not false. This passes one subtest in WPT's css/selectors/user-valid.html.
This commit is contained in:
parent
783ae44462
commit
d49fb169bc
Notes:
github-actions[bot]
2025-08-14 09:56:16 +00:00
Author: https://github.com/CountBleck 🔰
Commit: d49fb169bc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5851
Reviewed-by: https://github.com/gmta ✅
1 changed files with 3 additions and 3 deletions
|
@ -131,11 +131,11 @@ WebIDL::ExceptionOr<void> HTMLFormElement::submit_form(GC::Ref<HTMLElement> subm
|
|||
// NOTE: Only input, select and textarea elements have a user validity flag.
|
||||
// See https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#user-validity
|
||||
if (is<HTMLInputElement>(*element)) {
|
||||
(&as<HTMLInputElement>(*element))->set_user_validity(false);
|
||||
(&as<HTMLInputElement>(*element))->set_user_validity(true);
|
||||
} else if (is<HTMLSelectElement>(*element)) {
|
||||
(&as<HTMLSelectElement>(*element))->set_user_validity(false);
|
||||
(&as<HTMLSelectElement>(*element))->set_user_validity(true);
|
||||
} else if (is<HTMLTextAreaElement>(*element)) {
|
||||
(&as<HTMLTextAreaElement>(*element))->set_user_validity(false);
|
||||
(&as<HTMLTextAreaElement>(*element))->set_user_validity(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue