[whatwg] WebIDL vs HTML5 storage changes - delete behavior

Ian Hickson ian at hixie.ch
Tue Jan 13 17:08:26 PST 2009

On Wed, 14 Jan 2009, Cameron McCormack wrote:
> > 
> >    [NameCreator, NameDeleter, NameGetter, NameSetter]
> >    interface DOMStringMap {};
> At the moment, the interface is useful only for JS (and other languages 
> that support this kind of indexing).  For other languages, a 
> DOMStringMap object would appear to be a completely opaque object 
> without any means of interacting with it.  Given that this is basically 
> meant to be a shorthand for getting/setting attributes with particular 
> names, I would be happy with it not existing in other language bindings. 
> Web IDL doesn’t have a mechanism to state that an interface member or 
> a definition should only be included if the target language binding is a 
> particular one, though.
> An alternative would be to put operations on the interface to act as the 
> getters/setters/etc., and use the [NoIndexingOperations] extended 
> attribute to indicate that these operations won’t correspond to 
> properties in language bindings such as ECMAScript.  That would then at 
> least make the interface useful for other languages.

What I would like to be able to say is: "This is how it works in JS. If 
you are implementing this in another language binding, contact me and 
we'll come up with a solution for that language."

I don't want this to only work in JS, I just haven't designed the API for 
the other languages. And I don't want to introduce a suboptimal design -- 
e.g. the above IDL would be meaningless for Perl, where objects don't have 
a concept of name getters, etc. But for Perl what we'd want is to expose a 
tied hash, which is the equivalent of what this is in JS. But we don't yet 
have WebIDL magic for Perl, so I can't say that yet.

Does that make sense?

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