mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
make the concept of has_listeners_for follow other implementations (#21044)
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
This commit is contained in:
parent
4f4c2a5922
commit
cf9ec700de
3 changed files with 4 additions and 14 deletions
|
@ -367,6 +367,8 @@ impl EventTarget {
|
|||
Ok(EventTarget::new(global, proto))
|
||||
}
|
||||
|
||||
/// Determine if there are any listeners for a given event type.
|
||||
/// See <https://github.com/whatwg/dom/issues/453>.
|
||||
pub fn has_listeners_for(&self, type_: &Atom) -> bool {
|
||||
match self.handlers.borrow().get(type_) {
|
||||
Some(listeners) => listeners.has_listeners(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue