diff --git a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp index d13df20e6d4..51439c210ed 100644 --- a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp @@ -29,7 +29,7 @@ void FormAssociatedElement::set_form(HTMLFormElement* form) bool FormAssociatedElement::enabled() const { // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled - auto const& html_element = const_cast(*this).form_associated_element_to_html_element(); + auto const& html_element = form_associated_element_to_html_element(); // A form control is disabled if any of the following conditions are met: // 1. The element is a button, input, select, textarea, or form-associated custom element, and the disabled attribute is specified on this element (regardless of its value). diff --git a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h index 61dbb83cb61..2950432e162 100644 --- a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h +++ b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h @@ -83,6 +83,7 @@ public: virtual String value() const { return String {}; } virtual HTMLElement& form_associated_element_to_html_element() = 0; + HTMLElement const& form_associated_element_to_html_element() const { return const_cast(*this).form_associated_element_to_html_element(); } // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-reset-control virtual void reset_algorithm() {};