Re: animate/transition height to/from auto

On 11/24/12 12:42 AM, Rik Cabanier wrote:
> getComputedStyle in WebKit and FF is returning '100px' which is not the
> used value. (I assume by 'used value' you mean the value in the style sheet)

Wrong assumption.  The value in the stylesheet is the "specified value". 
  The "used value" is what you have once you've actually gone and done 
layout and a few other things.  See 
http://www.w3.org/TR/CSS21/cascade.html#value-stages

>     Indeed.  The computed value is "auto" here.
>
> no, the '_resolved value'_ is auto according to the spec.

The _computed_ value is "auto" according to 
http://www.w3.org/TR/CSS21/visudet.html#the-height-property

The _resolved_ value is 100px because for this property it's the used 
value.  The spec for determining the used value of height in this case 
is http://www.w3.org/TR/CSS21/visudet.html#root-height (because of the 
"overflow" styling).

> The computed value is still what getComputedStyle() returns.

No.  It's just not.

> It seems up to the UA if it wants to return 'auto' or the actual height.

No, it's not.

> Maybe I'm reading the spec wrong or it is worded incorrectly...

You're just reading it totally wrong, and I'm not quite sure how you're 
managing it.  Apart from the incorrect assumption about "used value", of 
course.

> I don't disagree but there has to be some sort of simple rule.

Well, one simple rule is "no transitions to/from auto for height"...

-Boris

Received on Saturday, 24 November 2012 13:29:45 UTC