HTMLTableSectionElement.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 bool is_html_table_section_element() const override { return true; }
  25. virtual void initialize(JS::Realm&) override;
  26. virtual void visit_edges(Cell::Visitor&) override;
  27. JS::GCPtr<DOM::HTMLCollection> mutable m_rows;
  28. };
  29. }
  30. namespace Web::DOM {
  31. template<>
  32. inline bool Node::fast_is<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); }
  33. }