diff options
author | Rohan Prinja <rohan@cs.unc.edu> | 2016-11-10 02:24:01 -0500 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-11-30 23:23:41 +0100 |
commit | 973f77c00698938c1333c0df7da30993075264d1 (patch) | |
tree | 1f7533d43218cb3916acb812b7f5139848ed64d9 /components/script/dom/transitionevent.rs | |
parent | 8af2327e95fe2f229df27074b868aad56bce2252 (diff) | |
download | servo-973f77c00698938c1333c0df7da30993075264d1.tar.gz servo-973f77c00698938c1333c0df7da30993075264d1.zip |
Make WebIDL constructors take a more specific global if possible (fixes #14071)
Diffstat (limited to 'components/script/dom/transitionevent.rs')
-rw-r--r-- | components/script/dom/transitionevent.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/transitionevent.rs b/components/script/dom/transitionevent.rs index 1f487cb38a5..cc17e77eae1 100644 --- a/components/script/dom/transitionevent.rs +++ b/components/script/dom/transitionevent.rs @@ -13,6 +13,7 @@ use dom::bindings::reflector::reflect_dom_object; use dom::bindings::str::DOMString; use dom::event::Event; use dom::globalscope::GlobalScope; +use dom::window::Window; use servo_atoms::Atom; #[dom_struct] @@ -46,9 +47,10 @@ impl TransitionEvent { ev } - pub fn Constructor(global: &GlobalScope, + pub fn Constructor(window: &Window, type_: DOMString, init: &TransitionEventInit) -> Fallible<Root<TransitionEvent>> { + let global = window.upcast::<GlobalScope>(); Ok(TransitionEvent::new(global, Atom::from(type_), init)) } } |