W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

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

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 27 Jun 2013 19:27:13 +1000
Message-ID: <51CC0571.20709@mcc.id.au>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
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:


> [MapClass(DOMString, DOMString)]
> interface CSSVariablesMap {
>    DOMString get(DOMString varName);
>    boolean has(DOMString varName);
>    void set(DOMString varName, DOMString varValue);
>    DOMString delete(DOMString varName);
> }
> The [MapClass(keyType, valType, iteratorType?)] extended attribute
> takes two or three arguments.  The first two specify the types
> required of its keys and values.  The interface MUST define the "map
> tuples" for the interface, which consist of a unique key paired with a
> value.  Unless manually defined in the interface, the entries(),
> keys(), and values() methods, and the .size attribute, are
> automatically defined in terms of the "map tuples".  The third
> argument to the extended attribute defines which of the three is used
> for the @@iterator() method, and must be either "entries", "keys",
> "values", or omitted (which is the same as "entries").

I haven't added the iterator type argument to [MapClass] yet.  Can you 
go into some more detail about how that would work?

The spec needs a bunch of updating for iterators defined by @@iterator 

Please have a look at the new text and let me know if there are any issues.
Received on Thursday, 27 June 2013 09:27:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:13 UTC