W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: animate/transition height to/from auto

From: Rik Cabanier <cabanier@gmail.com>
Date: Fri, 23 Nov 2012 21:42:52 -0800
Message-ID: <CAGN7qDDUZLGgQiorY+wshyckHaEJy-QH1BQiKbKuPrNzEcwqbQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style@w3.org
On Fri, Nov 23, 2012 at 7:49 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 11/23/12 10:33 PM, Rik Cabanier wrote:
>> I guess it depends. In Chrome (WebKit?) the computed style inspector
>> says '100px'
> The "computed style" inspector is reporting what getComputedStyle returns,
> which is the CSS2 "computed value" for the 'height', not the current
> "computed value".  Nowadays what it's returning is called the "used value".
>  See http://dev.w3.org/csswg/cssom/**#resolved-value<http://dev.w3.org/csswg/cssom/#resolved-value>for the gory details.

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)

>  The spec says (1):
> Indeed.  The computed value is "auto" here.

no, the '*resolved value'* is auto according to the spec.
>From the spec:

If the property applies to the element or pseudo-element and the resolved
value <http://dev.w3.org/csswg/cssom/#resolved-value> of the 'display'
property is not none, the resolved
value<http://dev.w3.org/csswg/cssom/#resolved-value> is
the used value. *Otherwise the **resolved
* is the computed value*.

The computed value is still what getComputedStyle() returns. It seems up to
the UA if it wants to return 'auto' or the actual height.
Maybe I'm reading the spec wrong or it is worded incorrectly... [?]

>  I don't believe it is possible to implement the desired behavior for
>> this particular case.
> My point is that this is not an edge case.  This sort of thing is the
> common case for "auto", because "auto" heights are affected by so many
> factors and because they affect so many things around them differently than
> do fixed heights.

I don't disagree but there has to be some sort of simple rule.
The 'jump at 50%' seems like a solution that no one would ever want.

>  There are going to be many edge cases and possible
>> recursion problems that will be very hard to crack.
> Yes, agree.
>  A simply rule (= used the computed value) is much easier to understand
>> and can give the desired effect.
> No, it can't. The computed value here is "auto".  Now again, what should
> "0.3*0 + 0.7*auto" evaluate to, exactly?
> -Bors

(image/gif attachment: 330.gif)

Received on Saturday, 24 November 2012 05:43:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:23 UTC