mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
HTML: Add const qualified form_associated_element_to_html_element
Put the const cast in a common location to make the helper more convenient to use.
This commit is contained in:
parent
ad32227c83
commit
28ed8e5d0f
Notes:
github-actions[bot]
2024-08-01 10:18:02 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/28ed8e5d0f7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/876
2 changed files with 2 additions and 1 deletions
|
@ -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<FormAssociatedElement&>(*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).
|
||||
|
|
|
@ -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<FormAssociatedElement&>(*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() {};
|
||||
|
|
Loading…
Reference in a new issue