Re: Comments on CSS Transitions

On Feb 27, 2009, at 11:04 AM, Boris Zbarsky wrote:

> Tab Atkins Jr. wrote:
>> It seems clear that transitions are triggered whenever the specified
>> value changes, whether through direct manipulation or through the
>> cascade.
> It does?  The last time I looked into this it sounded to me like a
> transition is triggered whenever the _computed_ value of a property
> should change, and that this change should happen in increments.
> Computed value changes due to a transition should be ignored during  
> this
> process.

This is right.  In WebKit, we transition on the computed value of a  
property (not the specified value or used value).  Note that there  
have been requests to transition on the used value instead, the most  
obvious example being wanting to transition from, e.g., width:100% to  
width:50px.   If you transition on the computed value, then it's  
impossible to run an animation from width:auto to width:50px or from  
width:50% to width:80px, etc.

The problem with transitioning on the used value, though, is it can  
change when your style hasn't.... if you resize a window that contains  
a width:auto or width:100% block for example.  Obviously you don't  
want to run a transition in that case.

My own preference would be (for simplicity) to just stick with  
transitioning on the computed value and to just say "Tough" to people  
who want to animate width this way, but maybe others disagree.  We  
continue to get bugs in WebKit from confused people trying to animate  
auto widths to fixed values (or percents to fixed values) and not  
understanding why it doesn't work.


Received on Friday, 27 February 2009 17:53:23 UTC