mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb: Implement HTMLFormElement::checkValidity (constraint validation)
This change implements the requirements from the HTML spec at https://html.spec.whatwg.org/#statically-validate-the-constraints and https://html.spec.whatwg.org/#dom-form-checkvalidity — the parts of the HTML constraint validation API (aka “client-side form validation”) https://html.spec.whatwg.org/#the-constraint-validation-api for HTMLFormElement itself — as well as the code for the requirements at https://html.spec.whatwg.org/#check-validity-steps, which are the shared requirements for the checkValidity method for individual form controls.
This commit is contained in:
parent
b4e47f198a
commit
7c34746571
Notes:
github-actions[bot]
2025-02-26 04:14:35 +00:00
Author: https://github.com/sideshowbarker
Commit: 7c34746571
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3674
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 62 additions and 2 deletions
|
@ -78,6 +78,12 @@ public:
|
|||
GC::Ref<HTMLFormControlsCollection> elements() const;
|
||||
unsigned length() const;
|
||||
|
||||
struct StaticValidationResult {
|
||||
bool result;
|
||||
GC::RootVector<GC::Ref<DOM::Element>> unhandled_invalid_controls;
|
||||
};
|
||||
|
||||
StaticValidationResult statically_validate_constraints();
|
||||
WebIDL::ExceptionOr<bool> check_validity();
|
||||
WebIDL::ExceptionOr<bool> report_validity();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue