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

Issue 23451031: Fix AnimationBase::fractionalTime() to handle a scale of infinity (Closed)

Created:
7 years, 3 months ago by Steve Block
Modified:
7 years, 3 months ago
Reviewers:
dstockwell
CC:
blink-reviews, shans, rjwright, alancutter (OOO until 2018), Mike Lawther (Google), eae+blinkwatch, dglazkov+blink, dstockwell, Timothy Loh, darktears, Steve Block, dino_apple.com, Eric Willigers
Visibility:
Public.

Description

Fix AnimationBase::fractionalTime() to handle a scale of infinity When an animation is sampled at a fractionalTime of 1, KeyframeAnimation::fetchIntervalEndpointsForProperty() selects the last keyframe for both the 'previous' and 'next' keyframes to be used for blending. This results in a scale of infinity and AnimationBase::fractionalTime() resturns a value of -nan. When -nan is passed to the default timing function, we hit the ASSERT() in UnitBezier::solveCurveX(). If a linear timing function is used, the calculated property value is -nan, and we hit the ASSERT() in the CSSPrimitiveValue constructor. This change fixes the problem by ignoring the scale in AnimationBase::fractionalTime() in this case. This is safe because the fractionalTime is always zero once the offset has been accounted for, so the correct result is zero. R=dstockwell Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157564

Patch Set 1 #

Patch Set 2 : Added expected result #

Total comments: 2

Patch Set 3 : Added a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -2 lines) Patch
A LayoutTests/animations/sample-on-last-keyframe.html View 1 chunk +41 lines, -0 lines 0 comments Download
A LayoutTests/animations/sample-on-last-keyframe-expected.txt View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/page/animation/AnimationBase.cpp View 1 2 1 chunk +8 lines, -2 lines 0 comments Download
M Source/core/page/animation/KeyframeAnimation.cpp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Steve Block
7 years, 3 months ago (2013-09-10 06:09:49 UTC) #1
dstockwell
lgtm https://codereview.chromium.org/23451031/diff/4001/Source/core/page/animation/AnimationBase.cpp File Source/core/page/animation/AnimationBase.cpp (right): https://codereview.chromium.org/23451031/diff/4001/Source/core/page/animation/AnimationBase.cpp#newcode466 Source/core/page/animation/AnimationBase.cpp:466: if (offset) I had a hard time understanding ...
7 years, 3 months ago (2013-09-10 22:19:42 UTC) #2
Steve Block
https://codereview.chromium.org/23451031/diff/4001/Source/core/page/animation/AnimationBase.cpp File Source/core/page/animation/AnimationBase.cpp (right): https://codereview.chromium.org/23451031/diff/4001/Source/core/page/animation/AnimationBase.cpp#newcode466 Source/core/page/animation/AnimationBase.cpp:466: if (offset) I guess I don't see scale == ...
7 years, 3 months ago (2013-09-11 00:11:51 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/steveblock@chromium.org/23451031/11001
7 years, 3 months ago (2013-09-11 00:20:41 UTC) #4
commit-bot: I haz the power
7 years, 3 months ago (2013-09-11 02:17:38 UTC) #5
Message was sent while issue was closed.
Change committed as 157564

Powered by Google App Engine
This is Rietveld 408576698