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

Unified Diff: third_party/WebKit/Source/core/animation/CompositorAnimations.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
« no previous file with comments | « third_party/WebKit/Source/core/animation/AnimationEffect.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
index ba396983d294d138a892769b8e43f3fe9c5bfd50..fd3f332118dd73fa4655720c2944f46a511938ed 100644
--- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
+++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
@@ -654,7 +654,14 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, in
ASSERT(!properties.isEmpty());
for (const auto& property : properties) {
PropertySpecificKeyframeVector values;
- getKeyframeValuesForProperty(&effect, property, compositorTiming.scaledDuration, values);
+ // If the animation duration is infinite, it doesn't make sense to scale
+ // the keyframe offset, so use a scale of 1.0. This is connected to
+ // the known issue of how the Web Animations spec handles infinite
+ // durations. See https://github.com/w3c/web-animations/issues/142
+ double scale = compositorTiming.scaledDuration;
+ if (!std::isfinite(scale))
+ scale = 1.0;
+ getKeyframeValuesForProperty(&effect, property, scale, values);
CompositorTargetProperty::Type targetProperty;
OwnPtr<CompositorAnimationCurve> curve;
« no previous file with comments | « third_party/WebKit/Source/core/animation/AnimationEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698