aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/animationevent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/animationevent.rs')
-rw-r--r--components/script/dom/animationevent.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/components/script/dom/animationevent.rs b/components/script/dom/animationevent.rs
index 191b460228d..1a5179c7ebe 100644
--- a/components/script/dom/animationevent.rs
+++ b/components/script/dom/animationevent.rs
@@ -8,12 +8,13 @@ use crate::dom::bindings::codegen::Bindings::AnimationEventBinding::{
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::num::Finite;
-use crate::dom::bindings::reflector::reflect_dom_object;
+use crate::dom::bindings::reflector::reflect_dom_object2;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::event::Event;
use crate::dom::window::Window;
use dom_struct::dom_struct;
+use js::rust::HandleObject;
use servo_atoms::Atom;
#[dom_struct]
@@ -35,7 +36,11 @@ impl AnimationEvent {
}
pub fn new(window: &Window, type_: Atom, init: &AnimationEventInit) -> DomRoot<AnimationEvent> {
- let ev = reflect_dom_object(Box::new(AnimationEvent::new_inherited(init)), window);
+ Self::new_with_proto(window, None, type_, init)
+ }
+
+ fn new_with_proto(window: &Window, proto: Option<HandleObject>, type_: Atom, init: &AnimationEventInit) -> DomRoot<AnimationEvent> {
+ let ev = reflect_dom_object2(Box::new(AnimationEvent::new_inherited(init)), window, proto);
{
let event = ev.upcast::<Event>();
event.init_event(type_, init.parent.bubbles, init.parent.cancelable);
@@ -46,10 +51,11 @@ impl AnimationEvent {
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
+ proto: Option<HandleObject>,
type_: DOMString,
init: &AnimationEventInit,
) -> DomRoot<AnimationEvent> {
- AnimationEvent::new(window, Atom::from(type_), init)
+ AnimationEvent::new_with_proto(window, proto, Atom::from(type_), init)
}
}