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

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

Issue 196413030: Web animations: Supply CSS transition easing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use iteration duration when choosing accuracy during keyframe animation Created 6 years, 9 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/animation/css/CSSAnimations.cpp
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index b2b0bd35c5e3c1b19fa93bdee967f1d711b6d942..7eb685d56822f1dadd3447d8300ef429bc97e044 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -545,11 +545,19 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const
if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get()))
return;
+ Timing timing;
+ bool isPaused;
+ RefPtr<TimingFunction> timingFunction = timingFromAnimationData(anim, timing, isPaused);
+ ASSERT(!isPaused);
+ // Note that the backwards part is required for delay to work.
+ timing.fillMode = Timing::FillModeBoth;
+
KeyframeEffectModel::KeyframeVector keyframes;
RefPtrWillBeRawPtr<Keyframe> startKeyframe = Keyframe::create();
startKeyframe->setPropertyValue(id, from.get());
startKeyframe->setOffset(0);
+ startKeyframe->setEasing(timingFunction);
keyframes.append(startKeyframe);
RefPtrWillBeRawPtr<Keyframe> endKeyframe = Keyframe::create();
@@ -559,14 +567,6 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const
RefPtrWillBeRawPtr<KeyframeEffectModel> effect = KeyframeEffectModel::create(keyframes);
- Timing timing;
- bool isPaused;
- RefPtr<TimingFunction> timingFunction = timingFromAnimationData(anim, timing, isPaused);
- ASSERT(!isPaused);
- timing.timingFunction = timingFunction;
- // Note that the backwards part is required for delay to work.
- timing.fillMode = Timing::FillModeBoth;
-
update->startTransition(id, from.get(), to.get(), InertAnimation::create(effect, timing, isPaused));
ASSERT(!element->activeAnimations() || !element->activeAnimations()->isAnimationStyleChange());
}

Powered by Google App Engine
This is Rietveld 408576698