Re: [webidl] Add a [Maplike] tag?

On Thu, Jun 27, 2013 at 2:27 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> Tab Atkins Jr. wrote:
>> I've gone ahead and started using some pretend syntax for this in
>> <http://dev.w3.org/csswg/css-variables/#the-CSSVariablesMap-interface>:
>
> I've added most of this now:
>
>   http://dev.w3.org/2006/webapi/WebIDL/#MapClass
>   http://dev.w3.org/2006/webapi/WebIDL/#es-map-members

One thing that seems to be lacking is a way to set a [MapClass]
attribute with an existing Map.  Right now I'd have to do:

el.style.var.clear();
m.forEach(function(v,k) { el.style.var.set(k,v); });

I'd prefer it to be a little simpler, like:

el.style.var = m;

Is this something we can provide automatically, or does it need to be
done in prose each time?

~TJ

Received on Thursday, 27 June 2013 18:25:42 UTC