mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS+LibWeb: Add various fast_is<T>() helpers for common things
This commit is contained in:
committed by
Andreas Kling
parent
9f4a96de67
commit
737d9727c2
Notes:
github-actions[bot]
2025-12-20 15:14:14 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/737d9727c24 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7199
@@ -971,6 +971,9 @@ protected:
|
||||
Document(JS::Realm&, URL::URL const&, TemporaryDocumentForFragmentParsing = TemporaryDocumentForFragmentParsing::No);
|
||||
|
||||
private:
|
||||
// ^JS::Object
|
||||
virtual bool is_dom_document() const final { return true; }
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual GC::Ptr<EventTarget> global_event_handlers_to_event_target(FlyString const&) final { return *this; }
|
||||
|
||||
@@ -1372,3 +1375,10 @@ inline bool Node::fast_is<Document>() const { return is_document(); }
|
||||
bool is_a_registrable_domain_suffix_of_or_is_equal_to(StringView host_suffix_string, URL::Host const& original_host);
|
||||
|
||||
}
|
||||
|
||||
namespace JS {
|
||||
|
||||
template<>
|
||||
inline bool JS::Object::fast_is<Web::DOM::Document>() const { return is_dom_document(); }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user