diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp index fa5a80e5ce6..816367937a2 100644 --- a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp +++ b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp @@ -237,6 +237,13 @@ WebIDL::ExceptionOr FormAssociatedElement::set_form_action(String const& v return html_element.set_attribute(HTML::AttributeNames::formaction, value); } +// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity +bool FormAssociatedElement::report_validity() +{ + // The reportValidity() method, when invoked, must run the report validity steps on this element. + return report_validity_steps(); +} + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#check-validity-steps bool FormAssociatedElement::check_validity_steps() { diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Libraries/LibWeb/HTML/FormAssociatedElement.h index 5debe808954..1e8c647d425 100644 --- a/Libraries/LibWeb/HTML/FormAssociatedElement.h +++ b/Libraries/LibWeb/HTML/FormAssociatedElement.h @@ -140,6 +140,9 @@ public: String form_action() const; WebIDL::ExceptionOr set_form_action(String const&); + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity + bool report_validity(); + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-validity GC::Ref validity() const; diff --git a/Libraries/LibWeb/HTML/HTMLButtonElement.idl b/Libraries/LibWeb/HTML/HTMLButtonElement.idl index 371f8ddf599..c23b4152f58 100644 --- a/Libraries/LibWeb/HTML/HTMLButtonElement.idl +++ b/Libraries/LibWeb/HTML/HTMLButtonElement.idl @@ -32,7 +32,7 @@ interface HTMLButtonElement : HTMLElement { readonly attribute ValidityState validity; [FIXME] readonly attribute DOMString validationMessage; [FIXME] boolean checkValidity(); - [FIXME] boolean reportValidity(); + boolean reportValidity(); undefined setCustomValidity(DOMString error); readonly attribute NodeList labels; diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.idl b/Libraries/LibWeb/HTML/HTMLFieldSetElement.idl index 7bdf58c0f55..1e9575112ac 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.idl +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.idl @@ -18,6 +18,6 @@ interface HTMLFieldSetElement : HTMLElement { [FIXME, SameObject] readonly attribute ValidityState validity; [FIXME] readonly attribute DOMString validationMessage; [FIXME] boolean checkValidity(); - [FIXME] boolean reportValidity(); + boolean reportValidity(); undefined setCustomValidity(DOMString error); }; diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 0aa4b5adc11..4827c284430 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -2926,12 +2926,6 @@ WebIDL::ExceptionOr HTMLInputElement::check_validity() return check_validity_steps(); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity -WebIDL::ExceptionOr HTMLInputElement::report_validity() -{ - return report_validity_steps(); -} - Optional HTMLInputElement::default_role() const { // http://wpt.live/html-aam/roles-dynamic-switch.tentative.window.html "Disconnected " diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.h b/Libraries/LibWeb/HTML/HTMLInputElement.h index 5317f22bd06..39e3cd0e4a4 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -161,7 +161,6 @@ public: bool will_validate(); WebIDL::ExceptionOr check_validity(); - WebIDL::ExceptionOr report_validity(); WebIDL::ExceptionOr show_picker(); diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.idl b/Libraries/LibWeb/HTML/HTMLObjectElement.idl index c91494d5483..894575a88d3 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.idl +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.idl @@ -22,7 +22,7 @@ interface HTMLObjectElement : HTMLElement { readonly attribute ValidityState validity; [FIXME] readonly attribute DOMString validationMessage; [FIXME] boolean checkValidity(); - [FIXME] boolean reportValidity(); + boolean reportValidity(); undefined setCustomValidity(DOMString error); // Obsolete diff --git a/Libraries/LibWeb/HTML/HTMLOutputElement.idl b/Libraries/LibWeb/HTML/HTMLOutputElement.idl index 1b884fe336f..e23a774a579 100644 --- a/Libraries/LibWeb/HTML/HTMLOutputElement.idl +++ b/Libraries/LibWeb/HTML/HTMLOutputElement.idl @@ -19,7 +19,7 @@ interface HTMLOutputElement : HTMLElement { readonly attribute ValidityState validity; [FIXME] readonly attribute DOMString validationMessage; [FIXME] boolean checkValidity(); - [FIXME] boolean reportValidity(); + boolean reportValidity(); undefined setCustomValidity(DOMString error); readonly attribute NodeList labels; diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index e486ec02456..1179839a7bd 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -704,12 +704,6 @@ bool HTMLSelectElement::check_validity() return check_validity_steps(); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity -bool HTMLSelectElement::report_validity() -{ - return report_validity_steps(); -} - bool HTMLSelectElement::is_focusable() const { return enabled(); diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Libraries/LibWeb/HTML/HTMLSelectElement.h index 44159c0e146..d50250788d5 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.h +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.h @@ -64,7 +64,6 @@ public: bool will_validate(); bool check_validity(); - bool report_validity(); // ^EventTarget // https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute:the-select-element diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 4154c90c3ba..6e1a7e573b7 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -245,12 +245,6 @@ bool HTMLTextAreaElement::check_validity() return check_validity_steps(); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity -bool HTMLTextAreaElement::report_validity() -{ - return report_validity_steps(); -} - // https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-maxlength WebIDL::Long HTMLTextAreaElement::max_length() const { diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h index dffd0a6c624..a79cfeb4583 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -100,7 +100,6 @@ public: bool will_validate(); bool check_validity(); - bool report_validity(); WebIDL::Long max_length() const; WebIDL::ExceptionOr set_max_length(WebIDL::Long);