mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +00:00
LibWeb: Implement the form-control willValidate property
This change — part of the HTML constraint-validation API (aka “client-side form validation”) — implements the willValidate IDL/DOM attribute/property for all form controls that support it.
This commit is contained in:
parent
7da5869b14
commit
e79319ad85
Notes:
github-actions[bot]
2025-02-26 05:46:05 +00:00
Author: https://github.com/sideshowbarker
Commit: e79319ad85
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3690
Reviewed-by: https://github.com/tcl3 ✅
24 changed files with 256 additions and 9 deletions
|
@ -110,4 +110,15 @@ void HTMLOutputElement::clear_algorithm()
|
|||
string_replace_all({});
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate
|
||||
bool HTMLOutputElement::will_validate()
|
||||
{
|
||||
// The willValidate attribute's getter must return true, if this element is a candidate for constraint validation,
|
||||
// and false otherwise (i.e., false if any conditions are barring it from constraint validation).
|
||||
// A submittable element is a candidate for constraint validation
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#category-submit
|
||||
// Submittable elements: button, input, select, textarea, form-associated custom elements [but not output]
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue