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

Re: [cssom] CSS Value API

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 22 Apr 2010 13:49:42 +0900
To: "Boris Zbarsky" <bzbarsky@mit.edu>, "Ojan Vafai" <ojan@chromium.org>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.vbjro41p64w2qv@annevk-t60>
On Thu, 22 Apr 2010 07:22:55 +0900, Ojan Vafai <ojan@chromium.org> wrote:
> What are cases where it can be converted?

E.g. a value is given in 'px' but you want to know how much 'em' that is  
for the current element.

> Are you thinking something like
> converting em to px? I don't think we should transparently do conversions
> like this. It would make sense if you had something like
> element.computedStyle.margin.l[0].px, but for declared styles it seems  
> like we should throw. If we do decide to convert, there should at least  
> be a
> simple way to check if the value is set in px, em, whatever without
> resorting to string parsing.

That would be the type attribute on CSSValue. For <length> it would have  
constants like LENGTH_PX.

Anne van Kesteren
Received on Thursday, 22 April 2010 04:50:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:34 UTC