Serenity Operating System
1/*
2 * Copyright (c) 2020, the SerenityOS developers.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibWeb/ARIA/Roles.h>
10#include <LibWeb/HTML/FormAssociatedElement.h>
11#include <LibWeb/HTML/HTMLElement.h>
12
13namespace Web::HTML {
14
15class HTMLFieldSetElement final
16 : public HTMLElement
17 , public FormAssociatedElement {
18 WEB_PLATFORM_OBJECT(HTMLFieldSetElement, HTMLElement);
19 FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLFieldSetElement)
20
21public:
22 virtual ~HTMLFieldSetElement() override;
23
24 DeprecatedString const& type() const
25 {
26 static DeprecatedString fieldset = "fieldset";
27 return fieldset;
28 }
29
30 bool is_disabled() const;
31
32 // ^FormAssociatedElement
33 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
34 virtual bool is_listed() const override { return true; }
35
36 // https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
37 virtual bool is_auto_capitalize_inheriting() const override { return true; }
38
39 virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::group; }
40
41private:
42 HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
43
44 virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
45};
46
47}