[whatwg] DOMStringMap named properties
Ian Hickson
ian at hixie.ch
Tue Jan 13 02:23:04 PST 2009
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. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg
mailing list