W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2009

[whatwg] DOMStringMap named properties

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 13 Jan 2009 10:23:04 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0901131016390.7181@hixie.dreamhostps.com>
On Thu, 18 Dec 2008, Cameron McCormack wrote:
> 
> > [19:38] <Hixie> heycam: i'd much rather have the idl look like the js
> >   object and have [IndexSetter] etc take arguments to provide names
> >   for the other languages
> 
> But would you add those names? :)

Probably not. :-)


> If you definitely don?t want to use [NoIndexingOperations]

I'd rather not. Say this was implemented in Perl, for instance. I'd want 
to see this implemented as a tied hash, not as a hashref with methods. I 
don't know that the current IDL would be enough, and I wouldn't know how 
to write hte IDL today for that case either. Better, IMHO, to not specify 
that yet, and if it comes up, we can write IDL for that language.


> then the section should look like the following:
> 
>   The DOMStringMap interface represents a set of name-value pairs. When
>   a DOMStringMap object is instantiated, it is associated with three
>   algorithms: one for getting the list of name-value pairs, one for
>   setting names to certain values, and one for deleting names.
> 
>     [NameGetter, NameSetter, NameCreator, NameDeleter]
>     interface DOMStringMap {
>     };
> 
>   The names of the supported named properties on a DOMStringMap object
>   are the names of each pair returned by the algorithm for getting the
>   list of name-value pairs.
> 
>   When a DOMStringMap object is indexed to retrieve a named property
>   /name/, the following algorithm must be run:
> 
>     1. Let /pairs/ be the list returned from the algorithm for getting
>        the list of name-value pairs.
>     2. Let /pair/ be the entry in /pairs/ whose name component is equal
>        to /name/.
>     3. Return the value component of /pair/.
> 
>   When a DOMStringMap object is indexed to create or modify a named
>   property /name/ with value /value/, the algorithm for setting names to
>   certain values must be run, passing /name/ as the name and the
>   result of converting /value/ to a DOMString as the value.
> 
>   When a DOMStringMap object is indexed to delete a named property named
>   /name/, the algorithm for deleting names must be run, passing /name/
>   as the name.

I haven't quite used your text, but I used something much more like it 
than there was before. Please let me know if any of the discrepancies are 
problems I missed.


> If you go without [NoIndexingOperations], then I suggest specifying 
> somehow that HTMLElement::dataset only exist in language bindings that 
> support object indexing, or only in ECMAScript.

Added a note.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 13 January 2009 02:23:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:09 UTC