HTMLTableSectionElement.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include <LibWeb/WebIDL/Types.h>
  11. namespace Web::HTML {
  12. class HTMLTableSectionElement final : public HTMLElement {
  13. WEB_PLATFORM_OBJECT(HTMLTableSectionElement, HTMLElement);
  14. JS_DECLARE_ALLOCATOR(HTMLTableSectionElement);
  15. public:
  16. virtual ~HTMLTableSectionElement() override;
  17. JS::NonnullGCPtr<DOM::HTMLCollection> rows() const;
  18. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> insert_row(WebIDL::Long index);
  19. WebIDL::ExceptionOr<void> delete_row(WebIDL::Long index);
  20. // https://www.w3.org/TR/html-aria/#el-tbody
  21. // https://www.w3.org/TR/html-aria/#el-tfoot
  22. // https://www.w3.org/TR/html-aria/#el-thead
  23. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::rowgroup; }
  24. private:
  25. HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName);
  26. virtual bool is_html_table_section_element() const override { return true; }
  27. virtual void initialize(JS::Realm&) override;
  28. virtual void visit_edges(Cell::Visitor&) override;
  29. JS::GCPtr<DOM::HTMLCollection> mutable m_rows;
  30. };
  31. }
  32. namespace Web::DOM {
  33. template<>
  34. inline bool Node::fast_is<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); }
  35. }