HTMLTableRowElement.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/ARIA/Roles.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. namespace Web::HTML {
  10. class HTMLTableRowElement final : public HTMLElement {
  11. WEB_PLATFORM_OBJECT(HTMLTableRowElement, HTMLElement);
  12. public:
  13. virtual ~HTMLTableRowElement() override;
  14. JS::NonnullGCPtr<DOM::HTMLCollection> cells() const;
  15. int row_index() const;
  16. int section_row_index() const;
  17. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableCellElement>> insert_cell(i32 index);
  18. WebIDL::ExceptionOr<void> delete_cell(i32 index);
  19. // https://www.w3.org/TR/html-aria/#el-tr
  20. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::row; }
  21. private:
  22. HTMLTableRowElement(DOM::Document&, DOM::QualifiedName);
  23. virtual bool is_html_table_row_element() const override { return true; }
  24. virtual void initialize(JS::Realm&) override;
  25. virtual void visit_edges(Cell::Visitor&) override;
  26. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  27. JS::GCPtr<DOM::HTMLCollection> mutable m_cells;
  28. };
  29. }
  30. namespace Web::DOM {
  31. template<>
  32. inline bool Node::fast_is<HTML::HTMLTableRowElement>() const { return is_html_table_row_element(); }
  33. }