diff options
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index a8b20b6cf98..3f6c82b80ef 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -665,14 +665,11 @@ impl ScriptThread { } // https://html.spec.whatwg.org/multipage/#await-a-stable-state - pub fn await_stable_state<T: Runnable + Send + 'static>(task: T) { - //TODO use microtasks when they exist + pub fn await_stable_state(task: Microtask) { SCRIPT_THREAD_ROOT.with(|root| { if let Some(script_thread) = root.get() { let script_thread = unsafe { &*script_thread }; - let _ = script_thread.chan.send(CommonScriptMsg::RunnableMsg( - ScriptThreadEventCategory::DomEvent, - box task)); + script_thread.microtask_queue.enqueue(task); } }); } |