mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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 -->
This commit is contained in:
commit
f9d9cd3aae
108 changed files with 1957 additions and 1265 deletions
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue