HTMLTableSectionElement.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 bool is_presentational_hint(FlyString const&) const override;
  30. virtual void apply_presentational_hints(GC::Ref<CSS::CascadedProperties>) const override;
  31. GC::Ptr<DOM::HTMLCollection> mutable m_rows;
  32. };
  33. }
  34. namespace Web::DOM {
  35. template<>
  36. inline bool Node::fast_is<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); }
  37. }