W3C home > Mailing lists > Public > www-style@w3.org > September 2013

Re: [css-shapes][css-values] getComputedStyle for Percentages used as length

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 16 Sep 2013 13:32:49 -0700
Message-ID: <CAAWBYDCY++C+tZpjfh7_Mit0BUE1xSPbBz6hu_VAst9YcAMxpw@mail.gmail.com>
To: Fran├žois REMY <francois.remy.dev@outlook.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Mon, Sep 16, 2013 at 1:24 PM, Fran├žois REMY
<francois.remy.dev@outlook.com> wrote:
> After some discussion with Tab, it appears that getComputedStyle does not return the used style anymore, but some intermediate concept called the resolved style:
>
> # http://dev.w3.org/csswg/cssom/#resolved-values

It never returned the used style, and no CSS spec every claimed that.
This is not a recent change; it's always been this way since the
function was introduced.

gGS returns what CSS2 (not 2.1) called "computed style", but we now
call "used style" - 2.1 separated "computed" into today's computed
style and used style concepts.  For the handful of CSS2 properties
where it mattered, gCS still returns the used style.  For all new
properties, it returns the computed style, to keep the name halfway
sensical.

(Exception: for compat reasons, grid-definition-rows/columns returns
used style.)

> However, all documentation I can find actually says it returns the final used value:
>
> # https://developer.mozilla.org/en-US/docs/Web/API/window.getComputedStyle
> # http://docs.webplatform.org/wiki/css/cssom/methods/getComputedStyle
> # http://msdn.microsoft.com/en-us/library/ie/ff975168%28v=vs.85%29.aspx
> #
> # The returned object actually represents the CSS 2.1 used values, not the computed values.
>
> We should probably update those docs. I volunteer for doing the change, is it alright or is it premature?

Fix all of them, please; they've been wrong for a decade.

~TJ
Received on Monday, 16 September 2013 20:33:36 UTC

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