diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -211,20 +211,20 @@ ElementAnimations::EnsureStyleRuleFor(Ti
           dispatchStartOrIteration = !anim.IsPaused();
         }
       }
 
       // Set |positionInIteration| to the position from 0% to 100% along
       // the keyframes.
       NS_ABORT_IF_FALSE(currentIterationCount >= 0.0, "must be positive");
       PRUint32 whichIteration = int(currentIterationCount);
-      if (whichIteration == anim.mIterationCount) {
+      if (whichIteration == anim.mIterationCount && whichIteration != 0) {
         // When the animation's iteration count is an integer (as it
         // normally is), we need to end at 100% of its last iteration
-        // rather than 0% of the next one.
+        // rather than 0% of the next one (unless it's zero).
         --whichIteration;
       }
       double positionInIteration =
         currentIterationCount - double(whichIteration);
       bool thisIterationReverse = false;
       switch (anim.mDirection) {
         case NS_STYLE_ANIMATION_DIRECTION_NORMAL:
           thisIterationReverse = false;
