HTMLTableSectionElement.h 1.4 KB

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