Re: DOMStringMap - get keys, et length?

On Wed, 6 Aug 2008, Jeff Schiller wrote:
> 
> I think there should be a way to get a collection of key names from the 
> DOMStringMap [1].  How about adding a fourth method to this interface:
> 
> DOMStringList keys();  // XXX4 ?
> 
> Where this returns a DOMStringList [2] of keys (with no specification on 
> the order of keys, of course).

You can now do this just by iterating over the object itself.


> Also, I seem to remember seeing text in the HTML5 spec to the effect 
> that:
> 
> <span id="foo" data-bar="baz" />
>   alert( document.getElementById("foo").dataset.bar );
> 
> would spit out "baz".  I guess this was removed in favor of the 
> DOMStringMap interface?  If so, why?  Sorry, I know this must have been 
> discussed so a simple pointer to the discussion is fine.

On Wed, 6 Aug 2008, Thomas Broyer wrote:

> dataset is a DOMStringMap, which defines XXX1 as a [NameGetter], so 
> dataset.bar is equivalent to dataset.XXX1("bar")

Thomas is correct, except that the methods have been removed and it's all 
implicit now.

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 2 June 2009 07:59:37 UTC