mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Add fast_is<T>() for HTMLSlotElement
2.4x speed-up on StyleBench :^)
This commit is contained in:
parent
07b332e17c
commit
a6131634f1
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a6131634f1
2 changed files with 10 additions and 0 deletions
|
@ -103,6 +103,7 @@ public:
|
|||
virtual bool is_html_table_cell_element() const { return false; }
|
||||
virtual bool is_html_br_element() const { return false; }
|
||||
virtual bool is_html_button_element() const { return false; }
|
||||
virtual bool is_html_slot_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>);
|
||||
|
|
|
@ -39,6 +39,8 @@ public:
|
|||
private:
|
||||
HTMLSlotElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual bool is_html_slot_element() const override { return true; }
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
|
@ -47,3 +49,10 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<HTML::HTMLSlotElement>() const { return is_html_slot_element(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue