W3C home > Mailing lists > Public > www-style@w3.org > February 2010

RE: [cssom] Defining getComputedStyle

From: Richard Fink <rfink@readableweb.com>
Date: Wed, 3 Feb 2010 13:46:45 -0500
To: "'Anne van Kesteren'" <annevk@opera.com>, "'CSS WG'" <www-style@w3.org>
Message-ID: <000601caa501$3cacfa40$b606eec0$@com>
>Does this sound like a good direction?

FWIW: Yes indeed. Very much. I don't remember, but I might have used the term "appliedStyle" as a synonym for what I think you are proposing with the term "resolved values".
The confusion for me, with computedStyle is that it reflects the CSS and not the actual choice that the browser is making. 
For example, a rule with a font stack like this: p{font-family: georgia, serif;} requires the UA to choose. I need to be able to query to see if it's Georgia or the default serif. Getting a return value of "Georgia, serif", doesn't do me a whole lot of good. I can already ascertain that from the CSS and other script properties that tell me what CSS bears upon that element.
To extend the example: right now, the only way to know if a given font has loaded is based on the font's metrics. You have to write a string and measure its pixel height/width against pre-measured values.
Sounds like the long way around the problem, doesn't it?
I think "resolved values" would be highly useful.


-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of Anne van Kesteren
Sent: Wednesday, February 03, 2010 8:09 AM
Subject: [cssom] Defining getComputedStyle


I'm basically looking for some comments from implementors whether I'm  
heading in the right direction with this. I'm trying to define  
getComputedStyle and it seems the only way to do that is to define a new  
kind of value concept. I tentatively named it "Resolved values" (I forgot  
who suggested this to me, sorry!):


E.g. for the 'width' property it would say that if the property applies to  
the element (e.g. no display:none or display:inline) the resolved value is  
the used value in pixels and otherwise it would be the computed value.

How the value is serialized (including canonicalization) would be defined  
elsewhere is as that is more generally applicable.

Does this sound like a good direction? Thanks!

Kind regards,

Anne van Kesteren
Received on Wednesday, 3 February 2010 18:47:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:42 UTC