Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure idle animations become paused if seeked. #479

Merged
merged 1 commit into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
this._currentTimePending = false;
if (this._currentTime == newTime)
return;
if (this._idle) {
this._idle = false;
this._paused = true;
}
this._tickCurrentTime(newTime, true);
scope.invalidateEffects();
},
Expand Down Expand Up @@ -180,8 +184,9 @@
return;
this._inEffect = false;
this._idle = true;
this._paused = false;
this._finishedFlag = true;
this.currentTime = 0;
this._currentTime = 0;
this._startTime = null;
this._effect._update(null);
// effects are invalid after cancellation as the animation state
Expand Down
10 changes: 1 addition & 9 deletions test/web-platform-tests-expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ module.exports = {
},

'test/web-platform-tests/web-animations/interfaces/Animation/cancel.html': {
'After cancelling an animation, it can still be seeked':
'assert_equals: margin-left style is updated when cancelled animation is seeked expected "50px" but got "0px"',

'Animated style is cleared after calling Animation.cancel()':
'assert_not_equals: transform style is animated before cancelling got disallowed value "none"',
},
Expand Down Expand Up @@ -226,11 +223,6 @@ module.exports = {
'assert_throws: Expect InvalidStateError exception on calling pause() from idle with a negative playbackRate and infinite-duration animation function "function () {\n"use strict";\n animation.pause(); }" did not throw',
},

'test/web-platform-tests/web-animations/interfaces/Animation/playState.html': {
'Animation.playState is \'paused\' after cancelling an animation, seeking it makes it paused':
'assert_equals: After seeking an idle animation, it is effectively paused expected "paused" but got "idle"',
},

'test/web-platform-tests/web-animations/interfaces/Animation/playbackRate.html': {
'Test the effect of setting playbackRate while playing animation':
'FLAKY_TEST_RESULT',
Expand Down Expand Up @@ -1437,7 +1429,7 @@ module.exports = {
'assert_equals: expected "running" but got "idle"',

'Setting the start time clears the hold time':
'assert_equals: The current time is calculated from the hold time expected (number) 1000 but got (object) null',
'assert_approx_equals: The current time is calculated from the start time, not the hold time expected 2000 +/- 0.0005 but got 1000',

'Setting the start time of an animation without an active timeline':
'Animation with null timeline is not supported',
Expand Down