Re: [css3-transitions] transitioning to/from auto value

On Apr 26, 2010, at 10:47 AM, Brad Kemper wrote:

> I was attempting to use transitions in a project last week, and found it very limiting that I could not transition from "auto". I wanted to do a vertical wipe on a list by transitioning its 'height' (with 'overflow:hidden' on the list), but it didn't work well because it didn't start with a fixed height. I could not use percentage, because this was a absolutely positioned OL inside a much shorter, fixed height container.
> I also tried using 'clip:rect()', but this was not transitionable at all for some reason (why? I see now that it is not on the list, but I don't know why not). Anyway, I would have had the same problem with that, due to the screwiness of the 'clip' property needing a width and height instead of just four offsets. 
> I ended up transitioning from and to a negative margin on the first LI of the hidden overflow OL, but this had other negative side effects that I had to work around.
> So, I'd like to propose that a way be found to have to set up a transition to and from 'auto' or intrinsic lengths.  Is this patently impossible because we are setting up the transition prior to getting the used value? Or is there some way it could happen at a late enough stage to know what the actual height would be?

The main issue is that, when transitioning to an 'auto' height, the user agent would have to do a layout for the page in its final state in order to determine the destination height of the element. And, of course, that height may depend on all sorts of other style rules, some of which themselves may be animating, and which could also change for other reasons while the transition is running.

So, implementing this would be hard, and subject to unpredictable performance issues.

I do agree that it would be useful to have, however.

> Also, can we add 'clip:rect()' to the list of things that can be animated?



Received on Monday, 26 April 2010 17:57:35 UTC