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

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

Issue 24085002: Correctly apply per-keyframe timing functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 03c9a0f1ae96d233f3dc188d8a5553dd5fea3b82..ecb21def4edf13d71a95db953f99d27fab0863c5 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -123,7 +123,7 @@ static void resolveKeyframes(StyleResolver* resolver, Element* element, const Re
HashMap<double, RefPtr<TimingFunction> > perKeyframeTimingFunctions;
for (size_t i = 0; i < styleKeyframes.size(); ++i) {
const StyleKeyframe* styleKeyframe = styleKeyframes[i].get();
- RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element, style, styleKeyframe);
+ RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element, style, styleKeyframe, name);
RefPtr<Keyframe> keyframe = Keyframe::create();
const Vector<double>& offsets = styleKeyframe->keys();
ASSERT(!offsets.isEmpty());
@@ -133,12 +133,10 @@ static void resolveKeyframes(StyleResolver* resolver, Element* element, const Re
for (unsigned j = 0; j < properties->propertyCount(); j++) {
CSSPropertyID property = properties->propertyAt(j).id();
specifiedProperties.add(property);
- if (property == CSSPropertyWebkitAnimationTimingFunction || property == CSSPropertyAnimationTimingFunction) {
- // FIXME: This sometimes gets the wrong timing function. See crbug.com/288540.
- timingFunction = KeyframeValue::timingFunction(keyframeStyle.get(), name);
- } else if (CSSAnimations::isAnimatableProperty(property)) {
+ if (property == CSSPropertyWebkitAnimationTimingFunction || property == CSSPropertyAnimationTimingFunction)
+ timingFunction = KeyframeValue::timingFunction(*keyframeStyle);
+ else if (CSSAnimations::isAnimatableProperty(property))
keyframe->setPropertyValue(property, CSSAnimatableValueFactory::create(property, *keyframeStyle).get());
- }
}
keyframes.append(keyframe);
// The last keyframe specified at a given offset is used.

Powered by Google App Engine
This is Rietveld 408576698