mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
Merge EventTarget::{get_listeners, get_listeners_for}
This commit is contained in:
parent
b3964a8958
commit
590316a468
2 changed files with 7 additions and 11 deletions
|
@ -301,16 +301,12 @@ impl EventTarget {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_listeners(&self, type_: &Atom) -> Option<Vec<CompiledEventListener>> {
|
||||
self.handlers.borrow_mut().get_mut(type_).map(|listeners| {
|
||||
listeners.get_listeners(None, self, type_)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn get_listeners_for(&self, type_: &Atom, desired_phase: ListenerPhase)
|
||||
pub fn get_listeners_for(&self,
|
||||
type_: &Atom,
|
||||
desired_phase: Option<ListenerPhase>)
|
||||
-> Option<Vec<CompiledEventListener>> {
|
||||
self.handlers.borrow_mut().get_mut(type_).map(|listeners| {
|
||||
listeners.get_listeners(Some(desired_phase), self, type_)
|
||||
listeners.get_listeners(desired_phase, self, type_)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue