Clean up DOMManipulationTaskSource

This commit is contained in:
Keith Yeung 2016-06-02 15:27:08 -04:00
parent bdecfa13d2
commit 05fc799f92
9 changed files with 33 additions and 19 deletions

View file

@ -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 {