LibWeb: Unify will_validate for form associated elements

We had the same implementation in quiet a few places. With this change
we unify them in a single place
This commit is contained in:
Tete17 2025-08-29 17:59:15 +02:00 committed by Tim Ledbetter
commit 8ab568bc76
Notes: github-actions[bot] 2025-08-29 18:28:58 +00:00
16 changed files with 11 additions and 75 deletions

View file

@ -251,6 +251,14 @@ bool FormAssociatedElement::check_validity()
return check_validity_steps();
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate
bool FormAssociatedElement::will_validate() const
{
// 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).
return is_candidate_for_constraint_validation();
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#check-validity-steps
bool FormAssociatedElement::check_validity_steps()
{