Re: CSS Transitions Feedback

Lachlan Hunt wrote:
> [1] http://webkit.org/specs/CSSVisualEffects/CSSTransitions.html

This defines that the transitions are calculated based on the computed 
value, but this creates a problem in cases where the computed value is 
'auto'.

e.g. Assume an image has an intrinsic size of 100x100px, and the 
following rules are applied:

   img { width: 200px; height: 200px; transition-duration: 1s; }
   img:hover { width: auto; height: auto; }

Ordinariliy, when the :hover rules are applied, the used values would be 
the intrinsic width and height, respectively (100px for both).  But 
since the calculations are performed based on the computed value, which 
is 'auto' in this case, what is the expected result?  Since the actual 
width and height won't be known until after the used value is 
calculated, the calculation can't be performed.

WebKit seems to fallback to 0 in this case, and the image is shrunk all 
the way down to nothing.  If the values are reversed, then it gets even 
more interesting because WebKit first changes the image's dimensions to 
0 and then increases it to the new values from there.

e.g.
   img { width: auto; height: auto; transition-duration: 1s; }
   img:hover { width: 200px; height: 200px; }

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Wednesday, 10 December 2008 14:20:42 UTC