aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/uievent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/uievent.rs')
-rw-r--r--components/script/dom/uievent.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/components/script/dom/uievent.rs b/components/script/dom/uievent.rs
index b28bda898e7..b4d9e1135ac 100644
--- a/components/script/dom/uievent.rs
+++ b/components/script/dom/uievent.rs
@@ -19,6 +19,7 @@ use crate::dom::bindings::root::{DomRoot, MutNullableDom};
use crate::dom::bindings::str::DOMString;
use crate::dom::event::{Event, EventBubbles, EventCancelable};
use crate::dom::window::Window;
+use crate::script_runtime::CanGc;
// https://w3c.github.io/uievents/#interface-uievent
#[dom_struct]
@@ -38,14 +39,15 @@ impl UIEvent {
}
pub fn new_uninitialized(window: &Window) -> DomRoot<UIEvent> {
- Self::new_uninitialized_with_proto(window, None)
+ Self::new_uninitialized_with_proto(window, None, CanGc::note())
}
fn new_uninitialized_with_proto(
window: &Window,
proto: Option<HandleObject>,
+ can_gc: CanGc,
) -> DomRoot<UIEvent> {
- reflect_dom_object_with_proto(Box::new(UIEvent::new_inherited()), window, proto)
+ reflect_dom_object_with_proto(Box::new(UIEvent::new_inherited()), window, proto, can_gc)
}
pub fn new(
@@ -56,7 +58,16 @@ impl UIEvent {
view: Option<&Window>,
detail: i32,
) -> DomRoot<UIEvent> {
- Self::new_with_proto(window, None, type_, can_bubble, cancelable, view, detail)
+ Self::new_with_proto(
+ window,
+ None,
+ type_,
+ can_bubble,
+ cancelable,
+ view,
+ detail,
+ CanGc::note(),
+ )
}
fn new_with_proto(
@@ -67,8 +78,9 @@ impl UIEvent {
cancelable: EventCancelable,
view: Option<&Window>,
detail: i32,
+ can_gc: CanGc,
) -> DomRoot<UIEvent> {
- let ev = UIEvent::new_uninitialized_with_proto(window, proto);
+ let ev = UIEvent::new_uninitialized_with_proto(window, proto, can_gc);
ev.InitUIEvent(
type_,
bool::from(can_bubble),
@@ -83,6 +95,7 @@ impl UIEvent {
pub fn Constructor(
window: &Window,
proto: Option<HandleObject>,
+ can_gc: CanGc,
type_: DOMString,
init: &UIEventBinding::UIEventInit,
) -> Fallible<DomRoot<UIEvent>> {
@@ -96,6 +109,7 @@ impl UIEvent {
cancelable,
init.view.as_deref(),
init.detail,
+ can_gc,
);
Ok(event)
}