mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:27:34 +00:00
LibWeb: Add fast_is<T>() for various types stood out in a profile
This commit is contained in:
parent
f6426cdcd4
commit
1cf5737e9e
8 changed files with 48 additions and 0 deletions
|
@ -29,6 +29,9 @@ public:
|
|||
private:
|
||||
HTMLBodyElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
// ^DOM::Node
|
||||
virtual bool is_html_body_element() const override { return true; }
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
|
@ -41,3 +44,8 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
template<>
|
||||
inline bool Node::fast_is<HTML::HTMLBodyElement>() const { return is_html_body_element(); }
|
||||
}
|
||||
|
|
|
@ -125,6 +125,9 @@ public:
|
|||
private:
|
||||
HTMLInputElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
// ^DOM::Node
|
||||
virtual bool is_html_input_element() const final { return true; }
|
||||
|
||||
// ^DOM::EventTarget
|
||||
virtual void did_receive_focus() override;
|
||||
virtual void legacy_pre_activation_behavior() override;
|
||||
|
@ -166,3 +169,8 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
template<>
|
||||
inline bool Node::fast_is<HTML::HTMLInputElement>() const { return is_html_input_element(); }
|
||||
}
|
||||
|
|
|
@ -39,6 +39,9 @@ public:
|
|||
private:
|
||||
HTMLProgressElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
// ^DOM::Node
|
||||
virtual bool is_html_input_element() const final { return true; }
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
|
||||
void progress_position_updated();
|
||||
|
@ -47,3 +50,8 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
template<>
|
||||
inline bool Node::fast_is<HTML::HTMLProgressElement>() const { return is_html_progress_element(); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue