Bug 1063992 - Set the animation player hold time to zero when it is initially paused; r=dzbarsky

This patch fixes a regression from bug 1033114, m-c changeset 9db3e43c19c1.

That changeset changed the meaning of mHoldTime (despite the commit message
which erroneously refers to mStartTime) to make it an offset from the start time
rather than a timestamp. However, it failed to update the case when we have an
initially-paused player. In that case the offset should be zero but the existing
code set it to the same value as the start time (which is, itself, an offset
from the beginning of the timeline) and the above changeset failed to update
that.
This commit is contained in:
Brian Birtles 2014-09-09 08:55:34 +09:00
parent 130c88c930
commit 9bf11140e4
2 changed files with 14 additions and 1 deletions

View File

@ -457,7 +457,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
dest->mStartTime = now;
dest->mPlayState = src.GetPlayState();
if (dest->IsPaused()) {
dest->mHoldTime = now;
dest->mHoldTime.SetValue(TimeDuration(0));
}
// While current drafts of css3-animations say that later keyframes

View File

@ -1131,6 +1131,19 @@ is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.8), 0.01,
"animation-play-state test 4 at 10050ms");
done_div();
// an initially paused animation (bug 1063992)
new_div("animation: anim1 1s paused both");
is(cs.marginLeft, "0px", "animation-play-state test 5, at 0s");
advance_clock(500);
is(cs.marginLeft, "0px", "animation-play-state test 5, at 0.5s");
div.style.animationPlayState = "running";
is(cs.marginLeft, "0px",
"animation-play-state test 5, at 0.5s after unpausing");
advance_clock(500);
is(cs.marginLeft, "80px",
"animation-play-state test 5, at 1s after unpaused");
done_div();
/*
* css3-animations: 3.8. The 'animation-delay' Property
* http://dev.w3.org/csswg/css3-animations/#the-animation-delay-property-