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

Unified Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 23875044: Web Animations: Correctly handle incomplete keyframes in CSS animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Handle end keyframes first 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
« no previous file with comments | « Source/core/animation/KeyframeAnimationEffect.cpp ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimations.cpp
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index b834812c8182db1b829f3afea65ff7c13546135c..e5f2ff1d261211c6c52f470e9ea7f1ed33117c0b 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -179,14 +179,18 @@ PassOwnPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const Element* ele
Timing timing;
RefPtr<TimingFunction> defaultTimingFunction = timingFromAnimationData(animationData, timing);
- KeyframeAnimationEffect::KeyframeVector keyframes;
- resolver->resolveKeyframes(element, style, animationName, defaultTimingFunction.get(), keyframes, timing.timingFunction);
- if (!keyframes.isEmpty()) {
+ Vector<std::pair<KeyframeAnimationEffect::KeyframeVector, RefPtr<TimingFunction> > > keyframesAndTimingFunctions;
+ resolver->resolveKeyframes(element, style, animationName, defaultTimingFunction.get(), keyframesAndTimingFunctions);
+ if (!keyframesAndTimingFunctions.isEmpty()) {
if (!update)
update = adoptPtr(new CSSAnimationUpdate());
HashSet<RefPtr<InertAnimation> > animations;
- // FIXME: crbug.com/268791 - Keyframes are already normalized, perhaps there should be a flag on KeyframeAnimationEffect to skip normalization.
- animations.add(InertAnimation::create(KeyframeAnimationEffect::create(keyframes), timing));
+ for (size_t j = 0; j < keyframesAndTimingFunctions.size(); ++j) {
+ ASSERT(!keyframesAndTimingFunctions[j].first.isEmpty());
+ timing.timingFunction = keyframesAndTimingFunctions[j].second;
+ // FIXME: crbug.com/268791 - Keyframes are already normalized, perhaps there should be a flag on KeyframeAnimationEffect to skip normalization.
+ animations.add(InertAnimation::create(KeyframeAnimationEffect::create(keyframesAndTimingFunctions[j].first), timing));
+ }
update->startAnimation(animationName, animations);
}
}
« no previous file with comments | « Source/core/animation/KeyframeAnimationEffect.cpp ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698