Bug 36557 - Animations use the wrong timing-function sometimes.
Summary: Animations use the wrong timing-function sometimes.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
Depends on:
Reported: 2010-03-24 14:38 PDT by Simon Fraser (smfr)
Modified: 2010-03-25 11:49 PDT (History)
2 users (show)

See Also:

Testcase (1.46 KB, text/html)
2010-03-24 14:42 PDT, Simon Fraser (smfr)
no flags Details
Fixed testcase (1.05 KB, text/html)
2010-03-24 14:51 PDT, Simon Fraser (smfr)
no flags Details
Another testcase (866 bytes, text/html)
2010-03-24 15:03 PDT, Dean Jackson
no flags Details
Testcase with color (908 bytes, text/html)
2010-03-25 10:56 PDT, Simon Fraser (smfr)
no flags Details
Patch (10.50 KB, patch)
2010-03-25 11:46 PDT, Simon Fraser (smfr)
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2010-03-24 14:38:56 PDT
If a CSS animations is specified using the shorthand in one rule, and a later rule specifies a longhand property, then the animation uses the wrong timing-function. See testcase.
Comment 1 Simon Fraser (smfr) 2010-03-24 14:42:07 PDT
Created attachment 51543 [details]
Comment 2 Simon Fraser (smfr) 2010-03-24 14:51:55 PDT
Created attachment 51548 [details]
Fixed testcase
Comment 3 Dean Jackson 2010-03-24 15:03:08 PDT
Created attachment 51553 [details]
Another testcase

This testcase shows how it works fine if no script is involved.
Comment 4 Simon Fraser (smfr) 2010-03-24 18:28:25 PDT
The issue is that CSSStyleSelector::keyframeStylesForAnimation() is called with the old render style (which just contains the -webkit-animation-iteration-count:, and thus has the default timing function) here:

#3  WebCore::CSSStyleSelector::keyframeStylesForAnimation (this=0x107087c00, e=0x1066f9fd0, elementStyle=0x1066f99a0, list=@0x1066f2068) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/css/CSSStyleSelector.cpp:1341
#4  0x00000001025ec497 in WebCore::KeyframeAnimation::KeyframeAnimation (this=0x1066f2000, animation=0x1066f3700, renderer=0x1066f9268, index=0, compAnim=0x1066f8bc0, unanimatedStyle=0x1066f99a0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/animation/KeyframeAnimation.cpp:52
#5  0x0000000101f6c43b in WebCore::KeyframeAnimation::create (animation=0x1066f3700, renderer=0x1066f9268, index=0, compositeAnimation=0x1066f8bc0, unanimatedStyle=0x1066f99a0) at KeyframeAnimation.h:46
#6  0x0000000101f6693c in WebCore::CompositeAnimation::updateKeyframeAnimations (this=0x1066f8bc0, renderer=0x1066f9268, currentStyle=0x1066f99a0, targetStyle=0x1066f30d0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/animation/CompositeAnimation.cpp:236
#7  0x0000000101f672f5 in WebCore::CompositeAnimation::animate (this=0x1066f8bc0, renderer=0x1066f9268, currentStyle=0x1066f99a0, targetStyle=0x1066f30d0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/animation/CompositeAnimation.cpp:267
#8  0x0000000101ebe36c in WebCore::AnimationController::updateAnimations (this=0x11b816528, renderer=0x1066f9268, newStyle=0x1066f30d0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/animation/AnimationController.cpp:485
#9  0x000000010275e7b1 in WebCore::RenderObject::setAnimatableStyle (this=0x1066f9268, style=@0x7fff5fbfd3c0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderObject.cpp:1502
Comment 5 Simon Fraser (smfr) 2010-03-25 10:56:21 PDT
Created attachment 51657 [details]
Testcase with color
Comment 6 Simon Fraser (smfr) 2010-03-25 11:46:03 PDT
Created attachment 51664 [details]
Comment 7 Geoffrey Garen 2010-03-25 11:47:41 PDT
Comment on attachment 51664 [details]

Comment 8 Simon Fraser (smfr) 2010-03-25 11:49:19 PDT