W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2008

Re: getComputedStyle results

From: Joćo Eiras <joao.eiras@gmail.com>
Date: Mon, 31 Mar 2008 07:34:06 +0100
To: "Boris Zbarsky" <bzbarsky@mit.edu>, kagupta@rim.com, "DOM mailing list" <www-dom@w3.org>
Message-ID: <op.t8va64hijz3wb9@foobar.wag54gs>

Na , Boris Zbarsky <bzbarsky@MIT.EDU> escreveu:

>
>> The getComputedStyle return value is already well defined to be the  
>> "computed" values as described in  
>> http://www.w3.org/TR/CSS21/cascade.html#computed-value.
>
> That definition postdates the definition of getComputedStyle.  The  
> "computed style" getComputedStyle references is the CSS2 one.  Since UAs  
> currently on the market do not implement the CSS2 computed style (which  
> is neither equivalent to the CSS2.1 computed style nor quite to the  
> CSS2.1 used style, iirc), it's actually not that clear what  
> getComputedStyle should be doing.
>
>> Yes, computed values are well defined, but DOM 2 StyleSheets defines  
>> getComputedStyle to return absolute (or used) values
>
> The term "absolute value" only makes sense for lengths.  I don't believe  
> DOM 2 StyleSheets uses the term "used style" anywhere (which makes  
> sense, since that term postdates the spec in question).

So we really should be looking into  
http://dev.w3.org/csswg/cssom/#css-value
The former spec mixed the two concepts, which either I'm not getting  
something, or is ambiguous.
But, there are many use case for having the user absolute values, pixels  
for lengths, hex or rgb for colors, while computed values are the rules as  
declared by the author and selected after the cascade.
So I'd like to propose to have two method to return both these values.
Like getComputedStyle would continue to reference computed values, and a  
new method like getAbsoluteStyle, with the same signature. Both "computed"  
and "absolute" concepts are defined in css2.1, and they should be too in  
css3.



>
> -Boris
>
Received on Monday, 31 March 2008 06:34:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:59 GMT