Re: animate/transition height to/from auto

On Friday 2012-11-23 21:42 -0800, Rik Cabanier wrote:
> 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)

No, CSS 2.0 had three concepts of value, specified, computed, and
actual:
http://www.w3.org/TR/1998/REC-CSS2-19980512/cascade.html#q1

CSS 2.1 introduced a fourth concept by splitting the concept of
computed value into two (to resolve some serious complications in
how things were supposed to work), to yield four concepts:
specified, computed, used, and actual:
http://www.w3.org/TR/2011/REC-CSS2-20110607/cascade.html#value-stages

The underlying problem was that CSS 2.0 pretended that things like
CSS inheritance could depend on layout computations, which was a
pretty serious violation of modularity in any reasonable design for
an implementation of CSS.  CSS 2.1 defined the computed value, which
never depends on layout calculations and thus can have the
inheritance behavior specified for computed values, and the used
value, which largely had the same value space as CSS 2.0 claimed
computed values did, but which depends on layout computations.

The definition of getComputedStyle refers to the CSS 2.0 concept of
computed value, which corresponds more closely in terms of what the
values look like (but not in terms of how they behave) to the CSS
2.1 used value.

Making things like transitions depend on layout seems to me to be a
bad idea, much like making inheritance depend on layout was.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Saturday, 24 November 2012 06:32:05 UTC