mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Multiple CanGc fixes in components/script/dom (#33924)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
parent
ee9e1fbbd6
commit
65c866285f
26 changed files with 77 additions and 37 deletions
|
@ -397,8 +397,8 @@ impl EventTarget {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn dispatch_event(&self, event: &Event) -> EventStatus {
|
||||
event.dispatch(self, false)
|
||||
pub fn dispatch_event(&self, event: &Event, can_gc: CanGc) -> EventStatus {
|
||||
event.dispatch(self, false, can_gc)
|
||||
}
|
||||
|
||||
pub fn remove_all_listeners(&self) {
|
||||
|
@ -779,12 +779,12 @@ impl EventTargetMethods for EventTarget {
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent
|
||||
fn DispatchEvent(&self, event: &Event) -> Fallible<bool> {
|
||||
fn DispatchEvent(&self, event: &Event, can_gc: CanGc) -> Fallible<bool> {
|
||||
if event.dispatching() || !event.initialized() {
|
||||
return Err(Error::InvalidState);
|
||||
}
|
||||
event.set_trusted(false);
|
||||
Ok(match self.dispatch_event(event) {
|
||||
Ok(match self.dispatch_event(event, can_gc) {
|
||||
EventStatus::Canceled => false,
|
||||
EventStatus::NotCanceled => true,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue