Further merging with b9e1856deef13f3b6aac70b5324f40b46284481d (mozilla-central): bustage fix.
authorL. David Baron <dbaron@dbaron.org>
Thu, 22 May 2014 07:40:06 +0900
changeset 12792 a40808b3382a92001155331aa457a5abd3e5cbfb
parent 12791 7f38c1c38a2ee5b443c666320c9bc8d657478158
child 12793 d035cd129188c30c89b3b6634ecfd65ee3f77baa
push id6352
push userdbaron@mozilla.com
push dateWed, 21 May 2014 22:40:11 +0000
Further merging with b9e1856deef13f3b6aac70b5324f40b46284481d (mozilla-central): bustage fix.
stop-animations
--- a/stop-animations
+++ b/stop-animations
@@ -118,39 +118,39 @@ diff --git a/layout/style/nsAnimationMan
 +nsAnimationManager::StopAllAnimations()
 +{
 +  for (PRCList *l = PR_LIST_HEAD(&mElementData); l != &mElementData;
 +       l = PR_NEXT_LINK(l)) {
 +    ElementAnimations *ea = static_cast<ElementAnimations*>(l);
 +    bool needsRestyle = false;
 +    for (uint32_t animIdx = 0, animEnd = ea->mAnimations.Length();
 +         animIdx != animEnd; ++animIdx) {
-+      StyleAnimation &anim = ea->mAnimations[animIdx];
-+      if (anim.IsPaused()) {
++      ElementAnimation* anim = ea->mAnimations[animIdx];
++      if (anim->IsPaused()) {
 +        continue;
 +      }
 +      TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
-+      if (anim.mIterationCount == NS_IEEEPositiveInfinity()) {
++      if (anim->mIterationCount == NS_IEEEPositiveInfinity()) {
 +        // Pause animations with an 'infinite'
 +        // animation-iteration-count.  (Should we consider forcing them
 +        // to the beginning or end of an iteration?)
-+        anim.mForcedPause = true;
-+        anim.mPauseStart = now;
++        anim->mForcedPause = true;
++        anim->mPauseStart = now;
 +        if (ea->mStyleRuleRefreshTime.IsNull() ||
 +            ea->mStyleRuleRefreshTime != now) {
 +          needsRestyle = true;
 +        }
 +      } else {
 +        // Push animations that complete, but have not completed yet, to
 +        // their completed state by adjusting their start time.
 +        TimeDuration durationToEnd = TimeDuration::FromSeconds(
-+            anim.mIterationDuration.ToSeconds() * anim.mIterationCount) +
-+          anim.mDelay;
-+        if (now < anim.mStartTime + durationToEnd) {
-+          anim.mStartTime = now - durationToEnd;
++            anim->mIterationDuration.ToSeconds() * anim->mIterationCount) +
++          anim->mDelay;
++        if (now < anim->mStartTime + durationToEnd) {
++          anim->mStartTime = now - durationToEnd;
 +          needsRestyle = true;
 +        }
 +      }
 +    }
 +    if (needsRestyle) {
 +      ea->PostRestyleForAnimation(mPresContext);
 +    }
 +  }