mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce a task! macro and use it for internal pause steps
This commit is contained in:
parent
46628fba05
commit
5412767f46
3 changed files with 29 additions and 10 deletions
|
@ -140,15 +140,11 @@ impl HTMLMediaElement {
|
|||
|
||||
// Step 2.3.
|
||||
let window = window_from_node(self);
|
||||
let target = Trusted::new(self.upcast::<EventTarget>());
|
||||
// FIXME(nox): Why are errors silenced here?
|
||||
let _ = window.dom_manipulation_task_source().queue(
|
||||
box InternalPauseStepsTask(Trusted::new(self.upcast())),
|
||||
window.upcast(),
|
||||
);
|
||||
struct InternalPauseStepsTask(Trusted<EventTarget>);
|
||||
impl Task for InternalPauseStepsTask {
|
||||
fn run(self: Box<Self>) {
|
||||
let target = self.0.root();
|
||||
box task!(internal_pause_steps: move || {
|
||||
let target = target.root();
|
||||
|
||||
// Step 2.3.1.
|
||||
target.fire_event(atom!("timeupdate"));
|
||||
|
@ -159,8 +155,9 @@ impl HTMLMediaElement {
|
|||
// Step 2.3.3.
|
||||
// FIXME(nox): Reject pending play promises with promises
|
||||
// and an "AbortError" DOMException.
|
||||
}
|
||||
}
|
||||
}),
|
||||
window.upcast(),
|
||||
);
|
||||
|
||||
// Step 2.4.
|
||||
// FIXME(nox): Set the official playback position to the current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue