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

Unified Diff: Source/core/page/animation/AnimationBase.cpp

Issue 23451031: Fix AnimationBase::fractionalTime() to handle a scale of infinity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added expected result Created 7 years, 3 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: Source/core/page/animation/AnimationBase.cpp
diff --git a/Source/core/page/animation/AnimationBase.cpp b/Source/core/page/animation/AnimationBase.cpp
index 48bcd2c2d28b9800e21530be6e75507b98b3e8fc..053eb5a9ac3bfcc57c2f078d8b9b825707cba9bc 100644
--- a/Source/core/page/animation/AnimationBase.cpp
+++ b/Source/core/page/animation/AnimationBase.cpp
@@ -463,9 +463,14 @@ double AnimationBase::fractionalTime(double scale, double elapsedTime, double of
|| m_animation->direction() == CSSAnimationData::AnimationDirectionReverse)
fractionalTime = 1 - fractionalTime;
- if (scale != 1 || offset)
- fractionalTime = (fractionalTime - offset) * scale;
+ if (offset)
dstockwell 2013/09/10 22:19:42 I had a hard time understanding that the special c
Steve Block 2013/09/11 00:11:52 I guess I don't see scale == infinity as a special
+ fractionalTime -= offset;
+ if (scale != 1.0 && fractionalTime) {
+ ASSERT(scale >= 0 && !std::isinf(scale));
+ fractionalTime *= scale;
+ }
+ ASSERT(fractionalTime >= 0 && fractionalTime <= 1);
return fractionalTime;
}
« no previous file with comments | « LayoutTests/animations/sample-on-last-keyframe-expected.txt ('k') | Source/core/page/animation/KeyframeAnimation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698