mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +00: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
2 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue