Re: animate/transition height to/from auto

On Fri, Nov 23, 2012 at 7:25 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 11/23/12 7:10 PM, Rik Cabanier wrote:
>
>> I think the transition should happen with computed values.
>>
>
> Note that the computed height of the outermost div is never "100px".


I guess it depends. In Chrome (WebKit?) the computed style inspector says
'100px'

The spec says (1):

*Computed value:*  the percentage or 'auto' (see prose under
<percentage><http://www.w3.org/TR/CSS21/syndata.html#value-def-percentage>)
or the absolute length



> What you really seem to want is that in some cases the computed value be
> converted to a used value (in a way the spec will need to define!  For
> example, which exact transitions should and should not be taken into
> account during that process?) and the transition effectively happen on used
> values.
>
>
>  So, at 50% the height of 'outer' is 50px, so 'middle' should be '25px'.
>>
>> When the transition is over, 'middle' will jump to become 100px.
>>
>
> This seems .. very undesirable to me.
>
> In particular, I suspect it will cause such transitions to be serious
> footguns.


I don't believe it is possible to implement the desired behavior for this
particular case. There are going to be many edge cases and possible
recursion problems that will be very hard to crack.
A simply rule (= used the computed value) is much easier to understand and
can give the desired effect.

1: http://www.w3.org/TR/CSS21/visudet.html#the-height-property

Received on Saturday, 24 November 2012 03:33:28 UTC