mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1166164 part 1 - Make setting the current time complete a pending pause, not abort it; r=jwatt
The point of making pausing async is to allow time to sync up the current time with the compositor. Setting the current time manually should simply force it to the specified time and complete the pause action, not abort it. (We do a similar thing for a pending play. For a pending play we're waiting to establish a suitable start time. Manually setting the start time in that case simply forces the start time to the specified time and completes the play operation.)
This commit is contained in:
parent
0cc4a5377f
commit
67c2a91189
@ -120,10 +120,14 @@ Animation::SetCurrentTime(const TimeDuration& aSeekTime)
|
||||
SilentlySetCurrentTime(aSeekTime);
|
||||
|
||||
if (mPendingState == PendingState::PausePending) {
|
||||
CancelPendingTasks();
|
||||
// Finish the pause operation
|
||||
mHoldTime.SetValue(aSeekTime);
|
||||
mStartTime.SetNull();
|
||||
|
||||
if (mReady) {
|
||||
mReady->MaybeResolve(this);
|
||||
}
|
||||
CancelPendingTasks();
|
||||
}
|
||||
|
||||
UpdateFinishedState(true);
|
||||
|
@ -186,8 +186,14 @@ async_test(function(t) {
|
||||
|
||||
// Set current time
|
||||
animation.currentTime = 5000;
|
||||
assert_equals(animation.playState, 'running',
|
||||
'Animation is running immediately after setting currentTime');
|
||||
assert_equals(animation.playState, 'paused',
|
||||
'Animation is paused immediately after setting currentTime');
|
||||
assert_equals(animation.startTime, null,
|
||||
'Animation startTime is unresolved immediately after ' +
|
||||
'setting currentTime');
|
||||
assert_equals(animation.currentTime, 5000,
|
||||
'Animation currentTime does not change when forcing a ' +
|
||||
'pause operation to complete');
|
||||
|
||||
// The ready promise should now be resolved. If it's not then test will
|
||||
// probably time out before anything else happens that causes it to resolve.
|
||||
@ -195,7 +201,7 @@ async_test(function(t) {
|
||||
})).then(t.step_func(function() {
|
||||
t.done();
|
||||
}));
|
||||
}, 'Setting the current time cancels a pending pause');
|
||||
}, 'Setting the current time completes a pending pause');
|
||||
|
||||
done();
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user