Re: [css-variables] CSSVariablesMap interface doubts

On Fri, Jun 14, 2013 at 5:58 PM, Claudio Saavedra <> wrote:
> Hi,
> I'm implementing the CSSVariablesMap interface in WK. I have a doubt
> regarding access to the elements in the map. Previously, if my memory is
> not failing me, for a block with a variable declared like
> div: {
>   var-foo: 10px;
> }
> it was specified that one could access it also as a property of the
> interface, directly:
> Code                      Value
>"foo")   10px
>          10px
> Is this direct access still allowed as of the latest specifications? I
> think it's not entirely clear.
> If the answer is yes, what should the behavior be, shall there be any
> variable with a name that conflicts with the methods in the interface?
> div {
>    var-has: 16px;
> }
> Code                      Value
>"has")     ?
>            ?

Yes, previously the latter was allowed.  TC39, the committee defining
JS, isn't a fan of those kinds of interfaces, though.  For example, if
you added " = 'bar';", then reading
"" would return "bar", even though there is *not* a
var-foo property on the style rule!

Instead, I recently opened up some discussion with TC39 about using
the JS Map interface more directly, because that avoids these
problems.  (And, as more generic Map-related functions show up,
they'll work on the var map as well.)

> Also, and slightly unrelated, in 4.2 there's a text "map tuples" with a
> hyperlink that seems to be pointing to the wrong place
> (
> Lastly, I seem not to be able to find where MapClass, the extended
> attribute used in the interface definition, is defined. Would someone
> care to point me out to it?

WebIDL hasn't been updated with that yet.  I went ahead and put in
some example IDL in Variables, which heycam (the WebIDL editor) will
use for inspiration when he gets time to put it in, sometime next
week.  When he does so, I'll update to whatever he ends up with.


Received on Friday, 14 June 2013 16:19:56 UTC