Serenity Operating System
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
13namespace Web::HTML {
14
15class HTMLTableSectionElement final : public HTMLElement {
16 WEB_PLATFORM_OBJECT(HTMLTableSectionElement, HTMLElement);
17
18public:
19 virtual ~HTMLTableSectionElement() override;
20
21 JS::NonnullGCPtr<DOM::HTMLCollection> rows() const;
22 WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> insert_row(long index);
23 WebIDL::ExceptionOr<void> delete_row(long index);
24
25 // https://www.w3.org/TR/html-aria/#el-tbody
26 // https://www.w3.org/TR/html-aria/#el-tfoot
27 // https://www.w3.org/TR/html-aria/#el-thead
28 virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::rowgroup; }
29
30private:
31 HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName);
32
33 virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
34 virtual void visit_edges(Cell::Visitor&) override;
35
36 JS::GCPtr<DOM::HTMLCollection> mutable m_rows;
37};
38
39}