RE: What is getComputedStyle supposed to be for?

"Specified" values are not necessarily interesting - they show you the
result of the CSS cascade, but that's probably not particularly useful
in real-world scenarios.  "Actual" values are very problematic to
expose- for example, the "actual" value of 'font-size' is a
per-character value, since different characters may get mapped to
different fonts.

-Chris Wilson

-----Original Message-----
From: Mark Morin [mailto:markpmorin@telusplanet.net] 
Sent: Monday, November 05, 2001 3:08 PM
To: www-style@w3.org
Subject: What is getComputedStyle supposed to be for?


I think I'm confused about what the intent is of getComputedStyle.  On
seeing the name I thought that it would give me access to the final
properties of elements but, since these "actual values" can be different
from the calculated values this isn't it.

I thought maybe the idea was to give access to as much style sheet
information as was available before any user agent specific information
was used (sort of like "specified value" except without resolving
inherited to the value of the parent element since that is a computed
value).  I don't think this is it since, to convert from relative to
absolute values in some cases, detailed information about the user
agent's font and pixel size need to be used.  Not to mention the user
agent style sheet, target media, and initial containing block size.

So it seems that a way of accessing specified, computed, or actual
values could have been provided and it was chosen to provide access to
the computed values.  Why?

How was getComputedStyle intended to be used and by whom?

I'm new here so apologies if this has been asked and answered before.

Thanks

Received on Monday, 5 November 2001 20:06:50 UTC