Bug 1334582 - Use UINT64_MAX instead of IsInfinite() for checking whether TimingParans.mIterations is infinite or not. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 12 Sep 2017 08:42:45 +0900
changeset 662702 9d00bd151a05dbd4f012a9ffbe906d7036e191e5
parent 662694 0ef39e821b67496cfb9e29de90367952e1a5174f
child 662703 181c4e66e7f76fd1bdc577d92fbaff1edec7a51d
push id79162
push userhikezoe@mozilla.com
push dateMon, 11 Sep 2017 23:43:18 +0000
reviewersboris
bugs1334582
milestone57.0a1
Bug 1334582 - Use UINT64_MAX instead of IsInfinite() for checking whether TimingParans.mIterations is infinite or not. r?boris Because our ComputedTiming.mCurrentIteration is uint64_t. MozReview-Commit-ID: FjbhEvTUMr4
dom/animation/AnimationEffectReadOnly.cpp
dom/animation/test/crashtests/1334582-1.html
dom/animation/test/crashtests/crashtests.list
--- a/dom/animation/AnimationEffectReadOnly.cpp
+++ b/dom/animation/AnimationEffectReadOnly.cpp
@@ -181,17 +181,17 @@ AnimationEffectReadOnly::GetComputedTimi
   // Factor in iteration start offset.
   if (IsFinite(overallProgress)) {
     overallProgress += result.mIterationStart;
   }
 
   // Determine the 0-based index of the current iteration.
   // https://w3c.github.io/web-animations/#current-iteration
   result.mCurrentIteration =
-    IsInfinite(result.mIterations) &&
+    result.mIterations >= UINT64_MAX &&
       result.mPhase == ComputedTiming::AnimationPhase::After
     ? UINT64_MAX // In GetComputedTimingDictionary(),
                  // we will convert this into Infinity
     : static_cast<uint64_t>(overallProgress);
 
   // Convert the overall progress to a fraction of a single iteration--the
   // simply iteration progress.
   // https://w3c.github.io/web-animations/#simple-iteration-progress
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/crashtests/1334582-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<script>
+window.onload = function(){
+  let a = document.documentElement.animate([], {"iterations": 1.7976931348623157e+308, "fill": "both"});
+};
+</script>
+</head>
+</html>
--- a/dom/animation/test/crashtests/crashtests.list
+++ b/dom/animation/test/crashtests/crashtests.list
@@ -18,15 +18,16 @@ pref(dom.animations-api.core.enabled,tru
 pref(dom.animations-api.core.enabled,true) load 1323114-2.html
 pref(dom.animations-api.core.enabled,true) load 1324554-1.html
 pref(dom.animations-api.core.enabled,true) load 1325193-1.html
 pref(dom.animations-api.core.enabled,true) load 1330190-1.html
 pref(dom.animations-api.core.enabled,true) load 1330190-2.html
 pref(dom.animations-api.core.enabled,true) load 1330513-1.html
 pref(dom.animations-api.core.enabled,true) load 1333539-1.html
 pref(dom.animations-api.core.enabled,true) load 1333539-2.html
+pref(dom.animations-api.core.enabled,true) load 1334582-1.html
 pref(dom.animations-api.core.enabled,true) load 1334583-1.html
 pref(dom.animations-api.core.enabled,true) load 1335998-1.html
 pref(dom.animations-api.core.enabled,true) load 1343589-1.html
 pref(dom.animations-api.core.enabled,true) load 1359658-1.html
 pref(dom.animations-api.core.enabled,true) load 1373712-1.html
 pref(dom.animations-api.core.enabled,true) load 1379606-1.html
 pref(dom.animations-api.core.enabled,true) load 1393605-1.html