aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source/dom_manipulation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/task_source/dom_manipulation.rs')
-rw-r--r--components/script/task_source/dom_manipulation.rs26
1 files changed, 8 insertions, 18 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index fbe864a9005..a1c06f2c09e 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -5,7 +5,7 @@
use dom::bindings::refcounted::Trusted;
use dom::event::{EventBubbles, EventCancelable};
use dom::eventtarget::EventTarget;
-use script_thread::{MainThreadRunnable, MainThreadScriptMsg, Runnable, ScriptThread};
+use script_thread::{MainThreadScriptMsg, Runnable, ScriptThread};
use std::result::Result;
use std::sync::mpsc::Sender;
use string_cache::Atom;
@@ -39,21 +39,12 @@ impl DOMManipulationTaskSource {
}
pub enum DOMManipulationTask {
- // https://html.spec.whatwg.org/multipage/#the-end step 7
- DocumentProgress(Box<Runnable + Send>),
// https://dom.spec.whatwg.org/#concept-event-fire
FireEvent(Trusted<EventTarget>, Atom, EventBubbles, EventCancelable),
// https://html.spec.whatwg.org/multipage/#fire-a-simple-event
FireSimpleEvent(Trusted<EventTarget>, Atom),
- // https://html.spec.whatwg.org/multipage/#details-notification-task-steps
- FireToggleEvent(Box<Runnable + Send>),
- // Placeholder until there's a real media element task queue implementation
- MediaTask(Box<Runnable + Send>),
- // https://html.spec.whatwg.org/multipage/#planned-navigation
- PlannedNavigation(Box<Runnable + Send>),
- // https://html.spec.whatwg.org/multipage/#send-a-storage-notification
- SendStorageNotification(Box<MainThreadRunnable + Send>),
- Miscellaneous(Box<Runnable + Send>),
+
+ Runnable(Box<Runnable + Send>),
}
impl DOMManipulationTask {
@@ -61,7 +52,6 @@ impl DOMManipulationTask {
use self::DOMManipulationTask::*;
match self {
- DocumentProgress(runnable) => runnable.handler(),
FireEvent(element, name, bubbles, cancelable) => {
let target = element.root();
target.fire_event(&*name, bubbles, cancelable);
@@ -70,11 +60,11 @@ impl DOMManipulationTask {
let target = element.root();
target.fire_simple_event(&*name);
}
- FireToggleEvent(runnable) => runnable.handler(),
- MediaTask(runnable) => runnable.handler(),
- PlannedNavigation(runnable) => runnable.handler(),
- SendStorageNotification(runnable) => runnable.handler(script_thread),
- Miscellaneous(runnable) => runnable.handler(),
+ Runnable(runnable) => {
+ if !runnable.is_cancelled() {
+ runnable.main_thread_handler(script_thread);
+ }
+ }
}
}
}