2020-07-31 23:07:00 -03:00
|
|
|
/*
|
2021-04-28 17:46:44 -03:00
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
2022-03-01 18:03:30 -03:00
|
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
2020-07-31 23:07:00 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-31 23:07:00 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-01-28 19:23:16 -03:00
|
|
|
#include <LibWeb/ARIA/Roles.h>
|
2021-10-14 12:18:49 -03:00
|
|
|
#include <LibWeb/HTML/FormAssociatedElement.h>
|
2022-03-23 19:55:54 -03:00
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
2020-07-31 23:07:00 -03:00
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
2022-03-23 19:55:54 -03:00
|
|
|
class HTMLTextAreaElement final
|
|
|
|
|
: public HTMLElement
|
|
|
|
|
, public FormAssociatedElement {
|
2022-08-28 08:42:07 -03:00
|
|
|
WEB_PLATFORM_OBJECT(HTMLTextAreaElement, HTMLElement);
|
2022-03-23 19:55:54 -03:00
|
|
|
FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLTextAreaElement)
|
|
|
|
|
|
2020-07-31 23:07:00 -03:00
|
|
|
public:
|
|
|
|
|
virtual ~HTMLTextAreaElement() override;
|
|
|
|
|
|
2022-12-04 15:02:33 -03:00
|
|
|
DeprecatedString const& type() const
|
2020-09-18 04:49:51 -03:00
|
|
|
{
|
2022-12-04 15:02:33 -03:00
|
|
|
static DeprecatedString textarea = "textarea";
|
2020-07-31 23:07:00 -03:00
|
|
|
return textarea;
|
|
|
|
|
}
|
2022-03-01 18:03:30 -03:00
|
|
|
|
2022-03-26 15:05:48 -03:00
|
|
|
// ^EventTarget
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute:the-textarea-element
|
|
|
|
|
virtual bool is_focusable() const override { return true; }
|
|
|
|
|
|
2022-03-01 18:03:30 -03:00
|
|
|
// ^FormAssociatedElement
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/forms.html#category-listed
|
|
|
|
|
virtual bool is_listed() const override { return true; }
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/forms.html#category-submit
|
|
|
|
|
virtual bool is_submittable() const override { return true; }
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/forms.html#category-reset
|
|
|
|
|
virtual bool is_resettable() const override { return true; }
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
|
|
|
|
|
virtual bool is_auto_capitalize_inheriting() const override { return true; }
|
|
|
|
|
|
|
|
|
|
// ^HTMLElement
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/forms.html#category-label
|
|
|
|
|
virtual bool is_labelable() const override { return true; }
|
2022-08-28 08:42:07 -03:00
|
|
|
|
2022-12-22 21:58:21 -03:00
|
|
|
virtual void reset_algorithm() override;
|
|
|
|
|
|
2022-11-28 20:58:13 -03:00
|
|
|
// https://www.w3.org/TR/html-aria/#el-textarea
|
2023-01-28 19:23:16 -03:00
|
|
|
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::textbox; }
|
2022-11-28 20:58:13 -03:00
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
private:
|
|
|
|
|
HTMLTextAreaElement(DOM::Document&, DOM::QualifiedName);
|
2022-11-05 00:58:14 -03:00
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 08:28:20 -03:00
|
|
|
|
2022-11-05 00:58:14 -03:00
|
|
|
// ^DOM::Element
|
|
|
|
|
virtual i32 default_tab_index_value() const override;
|
2020-07-31 23:07:00 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|