Bug 20892 - Transition starts running when it shouldn't
Summary: Transition starts running when it shouldn't
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
Depends on:
Reported: 2008-09-16 16:20 PDT by Chris Marrin
Modified: 2008-09-19 17:54 PDT (History)
2 users (show)

See Also:

test case showing bug (2.14 KB, text/html)
2008-09-16 16:21 PDT, Chris Marrin
no flags Details
Patch, including LayoutTest file (13.19 KB, patch)
2008-09-16 16:26 PDT, Chris Marrin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Marrin 2008-09-16 16:20:19 PDT
Run the attached test case and notice that it fails. This test has an animation and transition on the same property (-webkit-transform). The transition is never started, it's property is never changed. But when the animation starts, the AnimationController thinks the transition should start, because the animation starts changing the property.

The fix is to have the animation remember the style just before it started and use that to test the transition against. Patch is attached.
Comment 1 Chris Marrin 2008-09-16 16:21:12 PDT
Created attachment 23491 [details]
test case showing bug
Comment 2 Chris Marrin 2008-09-16 16:26:30 PDT
Created attachment 23492 [details]
Patch, including LayoutTest file
Comment 3 Dave Hyatt 2008-09-19 17:03:29 PDT
Comment on attachment 23492 [details]
Patch, including LayoutTest file

Comment 4 Chris Marrin 2008-09-19 17:04:23 PDT
The fix is basically to save the unanimated style when an animation is started, in that animation. Then, when starting a transition, I check to see if there is a current animation on the same prop. If so, I use the unanimated style as the fromStyle rather than the current style.
Comment 5 Dean Jackson 2008-09-19 17:54:08 PDT
Committed r36687
	M	WebCore/ChangeLog
	M	WebCore/page/animation/ImplicitAnimation.h
	M	WebCore/page/animation/CompositeAnimation.cpp
	M	WebCore/page/animation/KeyframeAnimation.cpp
	M	WebCore/page/animation/CompositeAnimation.h
	M	WebCore/page/animation/KeyframeAnimation.h
	M	WebCore/page/animation/ImplicitAnimation.cpp
	M	LayoutTests/ChangeLog
	A	LayoutTests/animations/transition-and-animation-1-expected.txt
	A	LayoutTests/animations/transition-and-animation-1.html