diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp index b09c8c9ab58..00ad0fccae4 100644 --- a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp +++ b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp @@ -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() { diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Libraries/LibWeb/HTML/FormAssociatedElement.h index 17e70cf8beb..16973c8a5c6 100644 --- a/Libraries/LibWeb/HTML/FormAssociatedElement.h +++ b/Libraries/LibWeb/HTML/FormAssociatedElement.h @@ -146,6 +146,9 @@ public: // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-checkvalidity bool check_validity(); + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate + bool will_validate() const; + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-validity GC::Ref validity() const; diff --git a/Libraries/LibWeb/HTML/HTMLButtonElement.cpp b/Libraries/LibWeb/HTML/HTMLButtonElement.cpp index 4d979d84ef6..f76a9fcfa17 100644 --- a/Libraries/LibWeb/HTML/HTMLButtonElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLButtonElement.cpp @@ -273,13 +273,6 @@ void HTMLButtonElement::activation_behavior(DOM::Event const& event) PopoverInvokerElement::popover_target_activation_behaviour(*this, as(*event.target())); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLButtonElement::will_validate() -{ - // The willValidate attribute's getter must return true, if this element is a candidate for constraint validation - return is_candidate_for_constraint_validation(); -} - bool HTMLButtonElement::is_focusable() const { return enabled(); diff --git a/Libraries/LibWeb/HTML/HTMLButtonElement.h b/Libraries/LibWeb/HTML/HTMLButtonElement.h index a1409360477..7d9cf2b0bc8 100644 --- a/Libraries/LibWeb/HTML/HTMLButtonElement.h +++ b/Libraries/LibWeb/HTML/HTMLButtonElement.h @@ -44,8 +44,6 @@ public: virtual void form_associated_element_attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value, Optional const& namespace_) override; - bool will_validate(); - // ^EventTarget // https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute:the-button-element // https://html.spec.whatwg.org/multipage/interaction.html#focusable-area diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index 4a092310791..5d81eb66555 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -88,15 +88,4 @@ GC::Ptr HTMLFieldSetElement::create_layout_node(GC::Ref(document(), *this, style); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLFieldSetElement::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 fieldset] - return false; -} - } diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index 7b2a4901809..3a6c461df02 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -42,8 +42,6 @@ public: virtual Optional default_role() const override { return ARIA::Role::group; } - static bool will_validate(); - virtual GC::Ptr create_layout_node(GC::Ref) override; Layout::FieldSetBox* layout_node(); Layout::FieldSetBox const* layout_node() const; diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 844db532acc..a43cb7253bc 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -2913,13 +2913,6 @@ WebIDL::ExceptionOr HTMLInputElement::step_up_or_down(bool is_down, WebIDL return {}; } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLInputElement::will_validate() -{ - // The willValidate attribute's getter must return true, if this element is a candidate for constraint validation - return is_candidate_for_constraint_validation(); -} - 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 8f05b911e6f..66ab3528e20 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -159,8 +159,6 @@ public: WebIDL::ExceptionOr step_up(WebIDL::Long n = 1); WebIDL::ExceptionOr step_down(WebIDL::Long n = 1); - bool will_validate(); - WebIDL::ExceptionOr show_picker(); // ^EventTarget diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 521fc9f8d0e..40597d4a836 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -81,17 +81,6 @@ void HTMLObjectElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_document_observer); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLObjectElement::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 object] - return false; -} - void HTMLObjectElement::form_associated_element_attribute_changed(FlyString const& name, Optional const&, Optional const&, Optional const&) { // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Libraries/LibWeb/HTML/HTMLObjectElement.h index 68efa1ec7d4..5033cdc4c1f 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -47,8 +47,6 @@ public: virtual void visit_edges(Cell::Visitor&) override; - static bool will_validate(); - private: HTMLObjectElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/HTML/HTMLOutputElement.cpp b/Libraries/LibWeb/HTML/HTMLOutputElement.cpp index bc5e2e7b963..db17f4a233b 100644 --- a/Libraries/LibWeb/HTML/HTMLOutputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLOutputElement.cpp @@ -110,15 +110,4 @@ 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; -} - } diff --git a/Libraries/LibWeb/HTML/HTMLOutputElement.h b/Libraries/LibWeb/HTML/HTMLOutputElement.h index d35a0d85b0f..2852665bc45 100644 --- a/Libraries/LibWeb/HTML/HTMLOutputElement.h +++ b/Libraries/LibWeb/HTML/HTMLOutputElement.h @@ -57,8 +57,6 @@ public: // https://www.w3.org/TR/html-aria/#el-output virtual Optional default_role() const override { return ARIA::Role::status; } - static bool will_validate(); - private: HTMLOutputElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index b99c49009d1..fdb1a8e81b4 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -691,13 +691,6 @@ void HTMLSelectElement::update_selectedness() update_inner_text_element(); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLSelectElement::will_validate() -{ - // The willValidate attribute's getter must return true, if this element is a candidate for constraint validation - return is_candidate_for_constraint_validation(); -} - bool HTMLSelectElement::is_focusable() const { return enabled(); diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Libraries/LibWeb/HTML/HTMLSelectElement.h index 26834c9e84b..c2cace292f9 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.h +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.h @@ -62,8 +62,6 @@ public: Vector> list_of_options() const; - bool will_validate(); - // ^EventTarget // https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute:the-select-element // https://html.spec.whatwg.org/multipage/interaction.html#focusable-area diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 53afd620c9f..4efb783ab77 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -232,13 +232,6 @@ u32 HTMLTextAreaElement::text_length() const return api_value().length_in_code_units(); } -// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate -bool HTMLTextAreaElement::will_validate() -{ - // The willValidate attribute's getter must return true, if this element is a candidate for constraint validation - return is_candidate_for_constraint_validation(); -} - // 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 6a8030a14f1..418b8ee80d2 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -98,8 +98,6 @@ public: u32 text_length() const; - bool will_validate(); - WebIDL::Long max_length() const; WebIDL::ExceptionOr set_max_length(WebIDL::Long);