Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1334582 - Check whether overall progress exceeds UINT64_MAX. r=boris
Browse files Browse the repository at this point in the history
The overall progress is factored in iteration start, so even if
TimingParams.mIterations is less than UINT64_MAX, it will exceed UINT64_MAX.

MozReview-Commit-ID: CEOYAGsCoIE
  • Loading branch information
Hiroyuki Ikezoe committed Sep 11, 2017
1 parent dccd6cb commit 7edd693
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dom/animation/AnimationEffectReadOnly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ AnimationEffectReadOnly::GetComputedTimingAt(
// Determine the 0-based index of the current iteration.
// https://w3c.github.io/web-animations/#current-iteration
result.mCurrentIteration =
result.mIterations >= UINT64_MAX &&
result.mPhase == ComputedTiming::AnimationPhase::After
(result.mIterations >= UINT64_MAX
&& result.mPhase == ComputedTiming::AnimationPhase::After)
|| overallProgress >= UINT64_MAX
? UINT64_MAX // In GetComputedTimingDictionary(),
// we will convert this into Infinity
: static_cast<uint64_t>(overallProgress);
Expand Down
11 changes: 11 additions & 0 deletions dom/animation/test/crashtests/1334582-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
window.onload = function(){
let a = document.documentElement.animate([], {"iterationStart": 1.7976931348623157e+308, "fill": "both"});
};
</script>
</head>
</html>
1 change: 1 addition & 0 deletions dom/animation/test/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ 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 1334582-2.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
Expand Down

0 comments on commit 7edd693

Please sign in to comment.