diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-03 16:42:46 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-03 16:42:46 -0700 |
commit | f9d9cd3aaed3326e8935f710f800288a50156c71 (patch) | |
tree | bdb10d2e66d82a73a46cdc53d62febaaec24da4d /components/script/script_thread.rs | |
parent | 2c69278067a23703b251a69c875bee49449c6bfc (diff) | |
parent | f16c05423c75fc166db9790d91ac06d7a105ca03 (diff) | |
download | servo-f9d9cd3aaed3326e8935f710f800288a50156c71.tar.gz servo-f9d9cd3aaed3326e8935f710f800288a50156c71.zip |
Auto merge of #8454 - jdm:media, r=KiChjang
Implement basic <media> infrastructure
This gets us to the point where we can start playing with actually integrating rust-media to process the data received by the network request, as currently it's just ignored.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8454)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 2896c2306dc..86f5a49ce6a 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -505,6 +505,19 @@ 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 + SCRIPT_THREAD_ROOT.with(|root| { + if let Some(script_thread) = *root.borrow() { + let script_thread = unsafe { &*script_thread }; + let _ = script_thread.chan.send(CommonScriptMsg::RunnableMsg( + ScriptThreadEventCategory::DomEvent, + box task)); + } + }); + } + /// Creates a new script thread. pub fn new(state: InitialScriptState, port: Receiver<MainThreadScriptMsg>, |