Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Unified Diff: third_party/WebKit/Source/core/animation/AnimationEffect.cpp

Issue 1888983003: Fix crash in keyframe-effect/getComputedTiming tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert test to ref test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/AnimationEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationEffect.cpp b/third_party/WebKit/Source/core/animation/AnimationEffect.cpp
index 6d30f7753e341f8866eaee79525aa89bef7ec55c..23543000b163cab0c424437174f0ee4f9ac653d8 100644
--- a/third_party/WebKit/Source/core/animation/AnimationEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationEffect.cpp
@@ -158,7 +158,16 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas
const double iterationTime = calculateIterationTime(iterationDuration, repeatedDuration(), scaledActiveTime, startOffset, m_timing);
currentIteration = calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, m_timing);
- timeFraction = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_timing) / iterationDuration;
+ const double transformedTime = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_timing);
+
+ // The infinite iterationDuration case here is a workaround because
+ // the specified behaviour does not handle infinite durations well.
+ // There is an open issue against the spec to fix this:
+ // https://github.com/w3c/web-animations/issues/142
+ if (!std::isfinite(iterationDuration))
+ timeFraction = fmod(m_timing.iterationStart, 1.0);
+ else
+ timeFraction = transformedTime / iterationDuration;
if (!isNull(iterationTime)) {
timeToNextIteration = (iterationDuration - iterationTime) / std::abs(m_timing.playbackRate);

Powered by Google App Engine
This is Rietveld 408576698