diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 6018284edc..f9be9fc584 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -95,6 +95,10 @@ public: virtual bool is_html_progress_element() const { return false; } virtual bool is_html_script_element() const { return false; } virtual bool is_html_template_element() const { return false; } + virtual bool is_html_table_element() const { return false; } + virtual bool is_html_table_section_element() const { return false; } + virtual bool is_html_table_row_element() const { return false; } + virtual bool is_html_table_cell_element() const { return false; } virtual bool is_navigable_container() const { return false; } WebIDL::ExceptionOr> pre_insert(JS::NonnullGCPtr, JS::GCPtr); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h index 3eb91d7be4..f389070a2d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h @@ -27,8 +27,15 @@ public: private: HTMLTableCellElement(DOM::Document&, DOM::QualifiedName); + virtual bool is_html_table_cell_element() const override { return true; } + virtual void initialize(JS::Realm&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_table_cell_element(); } +} diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h index f90d7b63b6..eae2e24cf2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -48,6 +48,8 @@ public: private: HTMLTableElement(DOM::Document&, DOM::QualifiedName); + virtual bool is_html_table_element() const override { return true; } + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; @@ -58,3 +60,8 @@ private: }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_table_element(); } +} diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h index 496535d33e..a9888e5db7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h @@ -30,6 +30,8 @@ public: private: HTMLTableRowElement(DOM::Document&, DOM::QualifiedName); + virtual bool is_html_table_row_element() const override { return true; } + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; @@ -38,3 +40,8 @@ private: }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_table_row_element(); } +} diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h index 9dc389acc1..7fd1c651f0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h @@ -30,6 +30,8 @@ public: private: HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName); + virtual bool is_html_table_section_element() const override { return true; } + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; @@ -37,3 +39,8 @@ private: }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_table_section_element(); } +}