HTMLTableSectionElement.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #pragma once
  8. #include <LibWeb/ARIA/Roles.h>
  9. #include <LibWeb/HTML/HTMLElement.h>
  10. namespace Web::HTML {
  11. class HTMLTableSectionElement final : public HTMLElement {
  12. WEB_PLATFORM_OBJECT(HTMLTableSectionElement, HTMLElement);
  13. public:
  14. virtual ~HTMLTableSectionElement() override;
  15. JS::NonnullGCPtr<DOM::HTMLCollection> rows() const;
  16. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> insert_row(long index);
  17. WebIDL::ExceptionOr<void> delete_row(long index);
  18. // https://www.w3.org/TR/html-aria/#el-tbody
  19. // https://www.w3.org/TR/html-aria/#el-tfoot
  20. // https://www.w3.org/TR/html-aria/#el-thead
  21. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::rowgroup; }
  22. private:
  23. HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName);
  24. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  25. virtual void visit_edges(Cell::Visitor&) override;
  26. JS::GCPtr<DOM::HTMLCollection> mutable m_rows;
  27. };
  28. }