Bug 1263063 - Part 3: Change logic in KeyFrameEffect to assume that TimingParams' iteration-count has already been validated as nonnegative & finite. r=dholbert
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Thu, 14 Apr 2016 19:36:03 +0900
changeset 293374 2c606174ee177c27f1230d65eb3ead1c70b4af1f
parent 293373 2a6ecb8e99275410cab7bd4a3c1f6dd7998bf240
child 293375 4160ea9c6de3c74e97a42a5fcef7f6739de0c002
push id30180
push userkwierso@gmail.com
push dateFri, 15 Apr 2016 21:31:41 +0000
treeherdermozilla-central@ded7cf683d5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1263063
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263063 - Part 3: Change logic in KeyFrameEffect to assume that TimingParams' iteration-count has already been validated as nonnegative & finite. r=dholbert MozReview-Commit-ID: 9mbBHvyjNZg
dom/animation/KeyframeEffect.cpp
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -239,19 +239,20 @@ KeyframeEffectReadOnly::GetComputedTimin
   ComputedTiming result;
 
   if (aTiming.mDuration) {
     MOZ_ASSERT(aTiming.mDuration.ref() >= zeroDuration,
                "Iteration duration should be positive");
     result.mDuration = aTiming.mDuration.ref();
   }
 
-  result.mIterations = IsNaN(aTiming.mIterations) || aTiming.mIterations < 0.0f ?
-                       1.0f :
-                       aTiming.mIterations;
+  MOZ_ASSERT(aTiming.mIterations >= 0.0 && !IsNaN(aTiming.mIterations),
+             "mIterations should be nonnegative & finite, as ensured by "
+             "ValidateIterations or CSSParser");
+  result.mIterations = aTiming.mIterations;
   MOZ_ASSERT(aTiming.mIterationStart >= 0.0,
              "mIterationStart should be nonnegative, as ensured by "
              "ValidateIterationStart");
   result.mIterationStart = aTiming.mIterationStart;
 
   result.mActiveDuration = ActiveDuration(result.mDuration, result.mIterations);
   result.mEndTime = aTiming.mDelay + result.mActiveDuration +
                     aTiming.mEndDelay;