mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Return a Vec from EventTarget::get_listeners_for
This commit is contained in:
parent
590316a468
commit
fc2cf31d5a
2 changed files with 26 additions and 30 deletions
|
@ -304,8 +304,8 @@ impl EventTarget {
|
|||
pub fn get_listeners_for(&self,
|
||||
type_: &Atom,
|
||||
desired_phase: Option<ListenerPhase>)
|
||||
-> Option<Vec<CompiledEventListener>> {
|
||||
self.handlers.borrow_mut().get_mut(type_).map(|listeners| {
|
||||
-> Vec<CompiledEventListener> {
|
||||
self.handlers.borrow_mut().get_mut(type_).map_or(vec![], |listeners| {
|
||||
listeners.get_listeners(desired_phase, self, type_)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue