Bug 36557

Summary: Animations use the wrong timing-function sometimes.
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, dino
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
Attachments:
Description Flags
Testcase
none
Fixed testcase
none
Another testcase
none
Testcase with color
none
Patch ggaren: review+

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]
Testcase
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]
Patch
Comment 7 Geoffrey Garen 2010-03-25 11:47:41 PDT
Comment on attachment 51664 [details]
Patch

r=me
Comment 8 Simon Fraser (smfr) 2010-03-25 11:49:19 PDT
http://trac.webkit.org/changeset/56562