Bug 1263063 - Part 2: Add an assertion to ensure that iteration count is nonnegative and finite. r?dholbert draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Thu, 14 Apr 2016 19:36:01 +0900
changeset 350873 b0e7493f14c8a0ef35d432b67f7c87ebfad2e5c8
parent 350872 52f53557b752eee773cf4069136f281b37564bc5
child 350874 e5d320d51e9d78ca63868739022a7b46e32a2dae
push id15434
push userbmo:hiikezoe@mozilla-japan.org
push dateThu, 14 Apr 2016 10:40:04 +0000
reviewersdholbert
bugs1263063
milestone48.0a1
Bug 1263063 - Part 2: Add an assertion to ensure that iteration count is nonnegative and finite. r?dholbert MozReview-Commit-ID: JvVaCVQAxW4
layout/style/nsAnimationManager.cpp
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -578,16 +578,19 @@ private:
     const StyleAnimation& aStyleAnimation)
   {
     TimingParams timing;
 
     timing.mDuration.emplace(StickyTimeDuration::FromMilliseconds(
 			       aStyleAnimation.GetDuration()));
     timing.mDelay = TimeDuration::FromMilliseconds(aStyleAnimation.GetDelay());
     timing.mIterations = aStyleAnimation.GetIterationCount();
+    MOZ_ASSERT(timing.mIterations >= 0.0 && !IsNaN(timing.mIterations),
+               "mIterations should be nonnegative & finite, as ensured by "
+               "CSSParser");
     timing.mDirection = aStyleAnimation.GetDirection();
     timing.mFill = aStyleAnimation.GetFillMode();
 
     return timing;
   }
 
   RefPtr<nsStyleContext> mStyleContext;
   RefPtr<dom::Element> mTarget;