diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2017-05-15 07:19:58 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2017-05-19 17:29:16 +0800 |
commit | a8390aea2451928153bd744e7eeb73fc70564124 (patch) | |
tree | 0848b50b49447aa9ce47a523f75e319f1915a442 /components/script/script_thread.rs | |
parent | 5da0aa9f11b7b1c2dc8b5adf178eebafa92d1849 (diff) | |
download | servo-a8390aea2451928153bd744e7eeb73fc70564124.tar.gz servo-a8390aea2451928153bd744e7eeb73fc70564124.zip |
use microtasks to await a stable state
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); } }); } |