mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement basic media resource selection and fetching.
This commit is contained in:
parent
5918954edd
commit
eae27adc4a
107 changed files with 1722 additions and 9 deletions
|
@ -517,6 +517,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