VERIFIED FIXED 21025
CSS transition with duration=0 and delay=0 doesn't override ongoing transition
https://bugs.webkit.org/show_bug.cgi?id=21025
Summary CSS transition with duration=0 and delay=0 doesn't override ongoing transition
Kari Hiitola
Reported 2008-09-23 07:22:16 PDT
When setting -webkit-transition-duration and -webkit-transition-delay to zero and starting a new transition during another transition, the new transition doesn't override the ongoing one but instead is completed after the ongoing transition is finished. In the supplied test page the moving text on the top (#bug) should move immediately back to the upper left corner after the 2s timeout (When the text changes). Changing the delay or duration in function "test_bug" to 1ms overcomes this as demonstrated on the bottom part (#ok). There is an explicit test for the zero-zero condition in the source code (WebCore/page/animation/CompositeAnimation.cpp) , and removing the test makes the problem disappear with the test page. I'm not sure if there would be any side-effects, though. It's not apparent to me, why immediate and undelayed transforms should not override the ongoing transition. As I've understood it, that wouldn't indicate an empty transition, as the code comments hint (// If this is an empty transition, skip it).
Attachments
LayoutTest file (557 bytes, text/html)
2008-09-29 17:52 PDT, Chris Marrin
no flags
Patch, including LayoutTest file (6.35 KB, patch)
2008-09-29 18:05 PDT, Chris Marrin
mitz: review+
Chris Marrin
Comment 1 2008-09-29 17:52:30 PDT
Created attachment 23925 [details] LayoutTest file
Chris Marrin
Comment 2 2008-09-29 17:54:10 PDT
Bug was as you suspected. But I had to add a bit of logic to make sure to not add a transition if the delay and duration were 0. To do so would, at least, fire an end transition event erroneously. I also added an optimization to avoid doing the property equality test if the duration and delay were 0.
Darin Adler
Comment 3 2008-09-29 18:02:19 PDT
Comment on attachment 23925 [details] LayoutTest file This is just the layout test file, not the patch at all!
Chris Marrin
Comment 4 2008-09-29 18:05:35 PDT
Created attachment 23928 [details] Patch, including LayoutTest file
Chris Marrin
Comment 5 2008-09-29 18:06:06 PDT
Comment on attachment 23928 [details] Patch, including LayoutTest file Sorry, grabbed the wrong file. I need a better naming scheme!
mitz
Comment 6 2008-10-10 11:16:53 PDT
Comment on attachment 23928 [details] Patch, including LayoutTest file r=me
Chris Marrin
Comment 7 2008-10-10 11:44:05 PDT
Sending LayoutTests/ChangeLog Adding LayoutTests/transitions/interrupt-zero-duration-expected.txt Adding LayoutTests/transitions/interrupt-zero-duration.html Sending WebCore/ChangeLog Sending WebCore/page/animation/CompositeAnimation.cpp Sending WebCore/page/animation/KeyframeAnimation.h Transmitting file data ...... Committed revision 37485.
Note You need to log in before you can comment on or make changes to this bug.