From 829259fb794831167c9992bd6b1c71bf81bd8023 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 15 Jul 2014 13:30:19 +0200 Subject: Introduce abstractions for global scopes. Part of #2811. --- src/components/script/script_task.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components/script/script_task.rs') diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index dfd121091cf..5551e9d6869 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -6,6 +6,7 @@ //! and layout tasks. use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, EventCast}; +use dom::bindings::global::Window; use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable}; use dom::bindings::js::OptionalRootable; use dom::bindings::utils::Reflectable; @@ -621,7 +622,7 @@ impl ScriptTask { // We have no concept of a document loader right now, so just dispatch the // "load" event as soon as we've finished executing all scripts parsed during // the initial load. - let event = Event::new(&*window, "load".to_string(), false, false).root(); + let event = Event::new(&Window(*window), "load".to_string(), false, false).root(); let doctarget: &JSRef = EventTargetCast::from_ref(&*document); let wintarget: &JSRef = EventTargetCast::from_ref(&*window); let _ = wintarget.dispatch_event_with_target(Some((*doctarget).clone()), @@ -719,7 +720,7 @@ impl ScriptTask { Some(ref frame) => { let window = frame.window.root(); let event = - Event::new(&*window, + Event::new(&Window(*window), "click".to_string(), true, true).root(); let eventtarget: &JSRef = EventTargetCast::from_ref(&node); -- cgit v1.2.3