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

Re: [cssom] CSS Value API

From: Anne van Kesteren <annevk@opera.com>
Date: Wed, 07 Apr 2010 11:08:23 +0200
To: "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.vasbn9z564w2qv@annevk-t60>
On Tue, 06 Apr 2010 15:39:18 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/6/10 6:28 AM, Anne van Kesteren wrote:
>> A value implements all the various component interfaces it supports.
>> E.g. 'width' takes both <length> and <percentage> so value objects for
>> it will support both the length and percentage component interfaces.
>
> And throws if the "wrong" one is accessed?

I think when it can be converted we should allow for that.


>> ele.style.margin.l[0].px++ // increases the px value of the first item
>
> So of margin-top?  What if it was set to "15%"?  Throw?

Why should it throw?

The idea is that it sets the first value of the shorthand and given the  
semantics of the shorthand if there is no second value it would also set  
all the other values. But maybe that makes things too complicated and it  
should be a map value after all.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Wednesday, 7 April 2010 09:09:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT