Bug 22598 - Applying element.style.WebkitTransform with transition set fails to animate
Summary: Applying element.style.WebkitTransform with transition set fails to animate
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: http://frozen-o.com/misc/enterpriseguts/
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-02 13:22 PST by Shawn Lauriat
Modified: 2009-01-25 02:34 PST (History)
0 users

See Also:


Attachments
A test HTML document that should rotate out the p element when you click the "Transform" link (614 bytes, text/html)
2009-01-03 22:07 PST, Shawn Lauriat
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Lauriat 2008-12-02 13:22:06 PST
The transition fails to apply, with no animation rendered like the rest of the transitions used in the presentation. Safari 4.0 (5528.1) does not show this issue, and animates the transform (though it has a different, unrelated timing issue).

The transition from slide nine to slide ten demonstrates this bug (you can skip to slide nine in the control bar revealed via mouse-over at the bottom of the screen).

Specifically, the JavaScript:

1. sets the current slide's style.WebkitTransform = 'matrix(1,0,0,1,0,0)' and the new slide's style.WebkitTransform = 'matrix(0,1.99,0,0,0,0) scale(.5)' in order to force a starting position.
2. sets both slides' style.WebkitTransition = 'all 1s ease-in-out'
3. sets the current slide's style.WebkitTransform = 'matrix(0,-1.99,0,0,0,0) scale(.5)' and the new slide's style.WebkitTransform = 'matrix(1,0,0,1,0,0)'

I would expect the current slide to perform a rotation to a line before disappearing, while the new slide performs the opposite, rotating into view.

Instead, the current slide disappears immediately, and then a second later the new slide appears with no transition.
Comment 1 Shawn Lauriat 2008-12-02 13:22:32 PST
P.S. If clicking through the presentation and/or picking through the script gets tedious, I can write up a simpler example later on to replicate the issue. I have several setTimeout hacks in place to get around a timing issue most likely long since fixed, where I had to fake multithreaded JavaScript in order to get the animation to render properly.
Comment 2 Simon Fraser (smfr) 2009-01-03 16:57:34 PST
Needs a reduced testcase.
Comment 3 Simon Fraser (smfr) 2009-01-03 17:47:28 PST
The transitions in S5 slides are buggy. See the comments on
<http://www.frozen-o.com/blog/2008/09/s5-with-css-slide-transitions-in-webkit.html>
Comment 4 Shawn Lauriat 2009-01-03 21:41:54 PST
(In reply to comment #3)
> The transitions in S5 slides are buggy. See the comments on
> <http://www.frozen-o.com/blog/2008/09/s5-with-css-slide-transitions-in-webkit.html>
> 

I fixed the noted bug shortly after seeing the comments there, but will post a greatly reduced test case so as not to lose the issue in a JavaScript/DOM/CSS haystack. I'll either resubmit, or just note what really happened if it really did stem from something else.
Comment 5 Shawn Lauriat 2009-01-03 22:07:47 PST
Created attachment 26406 [details]
A test HTML document that should rotate out the p element when you click the "Transform" link

This shows the same behavior I saw in my S5 presentation, but isolated for much easier debugging. It only works on a single element, and doesn't contain anything other than the example to demonstrate this bug.
Comment 6 Shawn Lauriat 2009-01-03 22:08:44 PST
I've attached a reduced test case, which reproduces the bug as described in the current WebKit nightly build.
Comment 7 Simon Fraser (smfr) 2009-01-04 10:57:41 PST
What are you trying to do with this matrix: matrix(0,-1.99,0,0,0,0) ?
That looks degenerate to me. Try applying a reasonable matrix:
"matrix(1, 0, 0, 1, 20, 20)"
and it works fine.
Comment 8 Shawn Lauriat 2009-01-25 02:34:50 PST
Found my issue! Thank you for your patience, and apologies for this...

If you set the WebkitTransform using just matrix() in the first step, then set the WebkitTransition, then set the WebkitTransform using both matrix and scale, it (reasonably) will not apply the transformation. When I set both both functions for the start and end styles, it works beautifully.