1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +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:
Luke Wilde 2023-02-28 18:39:11 +00:00 committed by Linus Groh
parent acd5382924
commit 80fad65e5b
2 changed files with 6 additions and 0 deletions

View file

@ -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();
}
}