mirror of
https://github.com/servo/servo.git
synced 2025-07-21 22:33:41 +01:00
This reverts commit 7fce850cff
.
This commit is contained in:
parent
45f2433d76
commit
8bc49299c8
86 changed files with 1193 additions and 517 deletions
|
@ -23,7 +23,6 @@ use servo_atoms::Atom;
|
|||
use servo_url::ServoUrl;
|
||||
|
||||
use super::bindings::trace::HashMapTracedValues;
|
||||
use crate::dom::abortsignal::AbortAlgorithm;
|
||||
use crate::dom::beforeunloadevent::BeforeUnloadEvent;
|
||||
use crate::dom::bindings::callback::{CallbackContainer, CallbackFunction, ExceptionHandling};
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
|
@ -705,7 +704,7 @@ impl EventTarget {
|
|||
None => return,
|
||||
};
|
||||
let mut handlers = self.handlers.borrow_mut();
|
||||
let entry = match handlers.entry(Atom::from(ty.clone())) {
|
||||
let entry = match handlers.entry(Atom::from(ty)) {
|
||||
Occupied(entry) => entry.into_mut(),
|
||||
Vacant(entry) => entry.insert(EventListeners(vec![])),
|
||||
};
|
||||
|
@ -717,20 +716,12 @@ impl EventTarget {
|
|||
};
|
||||
let new_entry = EventListenerEntry {
|
||||
phase,
|
||||
listener: EventListenerType::Additive(Rc::clone(&listener)),
|
||||
listener: EventListenerType::Additive(listener),
|
||||
once: options.once,
|
||||
};
|
||||
if !entry.contains(&new_entry) {
|
||||
entry.push(new_entry);
|
||||
}
|
||||
if let Some(signal) = options.signal {
|
||||
signal.add_abort_algorithm(AbortAlgorithm::RemoveEventListener(
|
||||
DomRoot::from_ref(&self),
|
||||
ty,
|
||||
listener,
|
||||
options.parent,
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
|
||||
|
@ -810,7 +801,6 @@ impl From<AddEventListenerOptionsOrBoolean> for AddEventListenerOptions {
|
|||
AddEventListenerOptionsOrBoolean::Boolean(capture) => Self {
|
||||
parent: EventListenerOptions { capture },
|
||||
once: false,
|
||||
signal: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue