Bug 1422248 - Don't reject promises of dispatch cancel events when canceling idle animations; r=hiro

MozReview-Commit-ID: EGg6Ntj0loq

--HG--
extra : rebase_source : 8edd6fdd73440fe55fd8be1d524767fdaf55b872
This commit is contained in:
Brian Birtles 2017-12-14 17:15:28 -06:00
Родитель fc1a84d3a9
Коммит 22ca1231e8
2 изменённых файлов: 8 добавлений и 13 удалений

Просмотреть файл

@ -786,14 +786,16 @@ Animation::SilentlySetPlaybackRate(double aPlaybackRate)
void
Animation::CancelNoUpdate()
{
ResetPendingTasks();
if (PlayState() != AnimationPlayState::Idle) {
ResetPendingTasks();
if (mFinished) {
mFinished->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
if (mFinished) {
mFinished->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
}
ResetFinishedPromise();
DispatchPlaybackEvent(NS_LITERAL_STRING("cancel"));
}
ResetFinishedPromise();
DispatchPlaybackEvent(NS_LITERAL_STRING("cancel"));
StickyTimeDuration activeTime = mEffect
? mEffect->GetComputedTiming().mActiveTime

Просмотреть файл

@ -1,7 +0,0 @@
[canceling-an-animation.html]
type: testharness
[The finished promise should NOT be rejected if the animation is already idle]
expected: FAIL
[The cancel event should NOT be fired if the animation is already idle]
expected: FAIL