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 17:21:43 +0200
To: "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.vassyheo64w2qv@annevk-t60>
On Wed, 07 Apr 2010 15:34:35 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/7/10 5:08 AM, Anne van Kesteren wrote:
>> The idea is that it sets the first value of the shorthand
> That's fine.  My specific question is:
>    <div id="x" style="margin-top: 15%">
>    <script>
>      document.getElementById("x").style.margin.l[0].px++;
>      // What just happened in the line above?
>    </script>

I think in this case you cannot convert and it would either throw or set  
the pixel value to 1. Not sure which way is better.

Your example makes me wonder though how shorthand and individual  
properties should interact. Maybe 'margin' should be a map and we should  
not try to recreate syntax-level features at the CSSOM-level. Now I  
phrased it like this I wonder why I ever thought otherwise. :-) I.e. the  
above would become style.margin.m.top.px++. We could even have  
margin.m.all.px++ or something to increase all individual properties if we  
ever wanted to simplify that.

Anne van Kesteren
Received on Wednesday, 7 April 2010 15:22:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:44 UTC