Re: Converting CSSStyleDeclaration values to other units

Ian,

Yes, but the problem with this is that you cannot get the relative value (say "em") to another relative unit (say "px").  Most scripts deal with pixels.  

The spec is also not clear on if the unit is absolute can you convert it to relative using this method.  I see that you cannot convert from one relative to another, but what about from an absolute to a relative?

It all boils down to though that the need to be able to convert to pixels is great, no matter what unit is was declared with.  Of course I am talking about ONLY computed styles, not style declarations.

Jeff.


---------- Original Message ----------------------------------
From: Ian Hickson <ian@hixie.ch>
Date: Wed, 18 Apr 2001 19:51:11 -0700 (Pacific Daylight Time)

On Wed, 18 Apr 2001, Jeff Yates wrote:
>
> Has the W3C been looking into a way of requesting the style in
> specified units for those styles that take units.

You mean:

   var CSS_MM = 7;
   style.getPropertyCSSValue('property').getFloatValue(CSS_MM);

...? See:

   http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue

...for more details.

-- 
Ian Hickson                                            )\     _. - ._.)   fL
Invited Expert, CSS Working Group                     /. `- '  (  `--'
The views expressed in this message are strictly      `- , ) -  > ) \
personal and not those of Netscape or Mozilla. ________ (.' \) (.' -' ______




--
Jeff Yates
e-mail:    PBWiz@PBWizard.com
Homepage:  http://www.PBWizard.com

--

Received on Wednesday, 18 April 2001 22:55:43 UTC