diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2016-06-02 15:27:08 -0400 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-06-02 15:27:08 -0400 |
commit | 05fc799f923813bf0b63d50218f916684a499b87 (patch) | |
tree | b7d036eebc3e13d18606df9105a19cb49d92b798 /components/script/dom/htmlscriptelement.rs | |
parent | bdecfa13d2114281472d5df4548a8faaf8a5bd87 (diff) | |
download | servo-05fc799f923813bf0b63d50218f916684a499b87.tar.gz servo-05fc799f923813bf0b63d50218f916684a499b87.zip |
Clean up DOMManipulationTaskSource
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index edd2152844e..780e5aa064b 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -462,16 +462,12 @@ impl HTMLScriptElement { if external { self.dispatch_load_event(); } else { - let script_element = Trusted::new(self.upcast::<EventTarget>()); - let task_source = window.dom_manipulation_task_source(); - task_source.queue(DOMManipulationTask::FireSimpleEvent(atom!("load"), script_element)).unwrap(); + window.dom_manipulation_task_source().queue_simple_event(self.upcast(), atom!("load")); } } pub fn queue_error_event(&self) { - let task_source = window_from_node(self).dom_manipulation_task_source(); - let script_element = Trusted::new(self.upcast::<EventTarget>()); - task_source.queue(DOMManipulationTask::FireSimpleEvent(atom!("error"), script_element)).unwrap(); + window_from_node(self).dom_manipulation_task_source().queue_simple_event(self.upcast(), atom!("error")); } pub fn dispatch_before_script_execute_event(&self) -> bool { |