LibWeb: Support fast_is<T>() for table, table sections, rows and cells
3.2x speed-up on WebKit/PerformanceTests/DOM/GridSort.html
This commit is contained in:
parent
76580bb9ba
commit
354d2ccc3c
Notes:
sideshowbarker
2024-07-17 05:06:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/354d2ccc3c Pull-request: https://github.com/SerenityOS/serenity/pull/20719
5 changed files with 32 additions and 0 deletions
|
@ -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<JS::NonnullGCPtr<Node>> pre_insert(JS::NonnullGCPtr<Node>, JS::GCPtr<Node>);
|
||||
|
|
|
@ -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<HTML::HTMLTableCellElement>() const { return is_html_table_cell_element(); }
|
||||
}
|
||||
|
|
|
@ -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<HTML::HTMLTableElement>() const { return is_html_table_element(); }
|
||||
}
|
||||
|
|
|
@ -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<HTML::HTMLTableRowElement>() const { return is_html_table_row_element(); }
|
||||
}
|
||||
|
|
|
@ -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<HTML::HTMLTableSectionElement>() const { return is_html_table_section_element(); }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue