/src/serenity/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2020, the SerenityOS developers. |
3 | | * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> |
4 | | * |
5 | | * SPDX-License-Identifier: BSD-2-Clause |
6 | | */ |
7 | | |
8 | | #pragma once |
9 | | |
10 | | #include <LibWeb/ARIA/Roles.h> |
11 | | #include <LibWeb/HTML/HTMLElement.h> |
12 | | #include <LibWeb/WebIDL/Types.h> |
13 | | |
14 | | namespace Web::HTML { |
15 | | |
16 | | class HTMLTableSectionElement final : public HTMLElement { |
17 | | WEB_PLATFORM_OBJECT(HTMLTableSectionElement, HTMLElement); |
18 | | JS_DECLARE_ALLOCATOR(HTMLTableSectionElement); |
19 | | |
20 | | public: |
21 | | virtual ~HTMLTableSectionElement() override; |
22 | | |
23 | | JS::NonnullGCPtr<DOM::HTMLCollection> rows() const; |
24 | | WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> insert_row(WebIDL::Long index); |
25 | | WebIDL::ExceptionOr<void> delete_row(WebIDL::Long index); |
26 | | |
27 | | // https://www.w3.org/TR/html-aria/#el-tbody |
28 | | // https://www.w3.org/TR/html-aria/#el-tfoot |
29 | | // https://www.w3.org/TR/html-aria/#el-thead |
30 | 0 | virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::rowgroup; } |
31 | | |
32 | | private: |
33 | | HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName); |
34 | | |
35 | 0 | virtual bool is_html_table_section_element() const override { return true; } |
36 | | |
37 | | virtual void initialize(JS::Realm&) override; |
38 | | virtual void visit_edges(Cell::Visitor&) override; |
39 | | |
40 | | virtual void apply_presentational_hints(CSS::StyleProperties&) const override; |
41 | | |
42 | | JS::GCPtr<DOM::HTMLCollection> mutable m_rows; |
43 | | }; |
44 | | |
45 | | } |
46 | | |
47 | | namespace Web::DOM { |
48 | | template<> |
49 | 0 | inline bool Node::fast_is<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); } |
50 | | } |