mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
committed by
Jelle Raaijmakers
parent
783ae44462
commit
d49fb169bc
Notes:
github-actions[bot]
2025-08-14 09:56:16 +00:00
Author: https://github.com/CountBleck 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d49fb169bc6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5851 Reviewed-by: https://github.com/gmta ✅
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user