2020-06-07 18:10:45 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-06-07 18:10:45 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-07 18:10:45 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-01-28 19:23:16 -03:00
|
|
|
#include <LibWeb/ARIA/Roles.h>
|
2020-07-26 10:08:16 -03:00
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
2020-06-07 18:10:45 -03:00
|
|
|
|
2020-07-28 13:20:36 -03:00
|
|
|
namespace Web::HTML {
|
2020-06-07 18:10:45 -03:00
|
|
|
|
2020-07-27 22:54:19 -03:00
|
|
|
class HTMLTableRowElement final : public HTMLElement {
|
2022-08-28 08:42:07 -03:00
|
|
|
WEB_PLATFORM_OBJECT(HTMLTableRowElement, HTMLElement);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(HTMLTableRowElement);
|
2020-07-27 01:04:26 -03:00
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
public:
|
2020-06-07 18:10:45 -03:00
|
|
|
virtual ~HTMLTableRowElement() override;
|
2022-02-26 07:43:52 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ref<DOM::HTMLCollection> cells() const;
|
2022-03-21 12:15:10 -03:00
|
|
|
|
|
|
|
|
int row_index() const;
|
|
|
|
|
int section_row_index() const;
|
2024-11-14 12:01:23 -03:00
|
|
|
WebIDL::ExceptionOr<GC::Ref<HTMLTableCellElement>> insert_cell(i32 index);
|
2022-11-05 12:19:16 -03:00
|
|
|
WebIDL::ExceptionOr<void> delete_cell(i32 index);
|
2022-08-28 08:42:07 -03:00
|
|
|
|
2022-11-28 20:58:13 -03:00
|
|
|
// https://www.w3.org/TR/html-aria/#el-tr
|
2023-01-28 19:23:16 -03:00
|
|
|
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::row; }
|
2022-11-28 20:58:13 -03:00
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
private:
|
|
|
|
|
HTMLTableRowElement(DOM::Document&, DOM::QualifiedName);
|
2022-11-24 15:03:22 -03:00
|
|
|
|
2023-08-22 09:55:10 -03:00
|
|
|
virtual bool is_html_table_row_element() const override { return true; }
|
|
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2022-11-24 15:03:22 -03:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
2023-07-04 12:18:59 -03:00
|
|
|
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
2022-11-24 15:03:22 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ptr<DOM::HTMLCollection> mutable m_cells;
|
2020-06-07 18:10:45 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
2023-08-22 09:55:10 -03:00
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
template<>
|
|
|
|
|
inline bool Node::fast_is<HTML::HTMLTableRowElement>() const { return is_html_table_row_element(); }
|
|
|
|
|
}
|