mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
LibWeb: Add function to EventTarget that says if it has any listeners
Required by XHR to determine if it should use CORS-preflight if its upload object has any event listeners.
This commit is contained in:
parent
acd5382924
commit
80fad65e5b
Notes:
sideshowbarker
2024-07-17 10:54:57 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/80fad65e5b Pull-request: https://github.com/SerenityOS/serenity/pull/17669 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg ✅
@ -744,4 +744,9 @@ bool EventTarget::has_event_listener(DeprecatedFlyString const& type) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EventTarget::has_event_listeners() const
|
||||
{
|
||||
return !m_event_listener_list.is_empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
void set_event_handler_attribute(DeprecatedFlyString const& name, WebIDL::CallbackType*);
|
||||
|
||||
bool has_event_listener(DeprecatedFlyString const& type) const;
|
||||
bool has_event_listeners() const;
|
||||
|
||||
protected:
|
||||
explicit EventTarget(JS::Realm&);
|
||||
|
Loading…
Reference in New Issue
Block a user