diff options
Diffstat (limited to 'components/script/dom/event.rs')
-rw-r--r-- | components/script/dom/event.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index 15dc5e6fed3..e156a07ff68 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -34,6 +34,7 @@ use crate::dom::node::{Node, ShadowIncluding}; use crate::dom::performance::reduce_timing_resolution; use crate::dom::virtualmethods::vtable_for; use crate::dom::window::Window; +use crate::script_runtime::CanGc; use crate::task::TaskOnce; #[dom_struct] @@ -76,14 +77,15 @@ impl Event { } pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<Event> { - Self::new_uninitialized_with_proto(global, None) + Self::new_uninitialized_with_proto(global, None, CanGc::note()) } pub fn new_uninitialized_with_proto( global: &GlobalScope, proto: Option<HandleObject>, + can_gc: CanGc, ) -> DomRoot<Event> { - reflect_dom_object_with_proto(Box::new(Event::new_inherited()), global, proto) + reflect_dom_object_with_proto(Box::new(Event::new_inherited()), global, proto, can_gc) } pub fn new( @@ -92,7 +94,7 @@ impl Event { bubbles: EventBubbles, cancelable: EventCancelable, ) -> DomRoot<Event> { - Self::new_with_proto(global, None, type_, bubbles, cancelable) + Self::new_with_proto(global, None, type_, bubbles, cancelable, CanGc::note()) } fn new_with_proto( @@ -101,8 +103,9 @@ impl Event { type_: Atom, bubbles: EventBubbles, cancelable: EventCancelable, + can_gc: CanGc, ) -> DomRoot<Event> { - let event = Event::new_uninitialized_with_proto(global, proto); + let event = Event::new_uninitialized_with_proto(global, proto, can_gc); event.init_event(type_, bool::from(bubbles), bool::from(cancelable)); event } @@ -111,6 +114,7 @@ impl Event { pub fn Constructor( global: &GlobalScope, proto: Option<HandleObject>, + can_gc: CanGc, type_: DOMString, init: &EventBinding::EventInit, ) -> Fallible<DomRoot<Event>> { @@ -122,6 +126,7 @@ impl Event { Atom::from(type_), bubbles, cancelable, + can_gc, )) } |