Re: [cssom] CSS Value API

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 UTC