HTMLTableSectionElement.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. * Copyright (c) 2022, Andreas Kling <andreas@ladybird.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. GC_DECLARE_ALLOCATOR(HTMLTableSectionElement);
  15. public:
  16. virtual ~HTMLTableSectionElement() override;
  17. GC::Ref<DOM::HTMLCollection> rows() const;
  18. WebIDL::ExceptionOr<GC::Ref<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. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  30. GC::Ptr<DOM::HTMLCollection> mutable m_rows;
  31. };
  32. }
  33. namespace Web::DOM {
  34. template<>
  35. inline bool Node::fast_is<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); }
  36. }