mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
LibWeb: Add fast_is<T>() helper for HTMLScriptElement
This makes loading Google Groups quite a bit faster, as 20% of runtime while loading was spent asking if DOM nodes are HTMLScriptElement.
This commit is contained in:
parent
97f0106edd
commit
4637d020c3
Notes:
sideshowbarker
2024-07-16 22:14:49 +09:00
Author: https://github.com/awesomekling
Commit: 4637d020c3
Pull-request: https://github.com/SerenityOS/serenity/pull/18697
2 changed files with 8 additions and 0 deletions
|
@ -58,6 +58,8 @@ public:
|
|||
private:
|
||||
HTMLScriptElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual bool is_html_script_element() const override { return true; }
|
||||
|
||||
virtual void resource_did_load() override;
|
||||
virtual void resource_did_fail() override;
|
||||
|
||||
|
@ -124,3 +126,8 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
template<>
|
||||
inline bool Node::fast_is<HTML::HTMLScriptElement>() const { return is_html_script_element(); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue