[whatwg] Make DOMStringMap constructable, and el.dataset writeable?

Boris Zbarsky bzbarsky at MIT.EDU
Fri Nov 30 17:49:47 PST 2012


On 11/30/12 7:07 PM, Tab Atkins Jr. wrote:
> Sure.  I presume you're afraid of multiple elements sharing the same object?

We can call it "afraid" or we can call it "nonsensical" since the object 
is just syntactic sugar on top of the (not shared) attributes the 
objects have.... ;)

>> Really, what we want to be able to do here is assign a string to .dataset
>> and have it do the right thing...  WebIDL doesn't really support that very
>> well; perhaps it should.
>
> What would the string be?  String-serialized JSON object?

Whatever you're proposing be passed to the DOMStringMap constructor, no?

> Isn't this what [PutForwards] is for?

Unfortunately, no.  [PutForwards] will take the RHS and pass it to the 
setter of some attribute of the LHS.  But that requires there to be such 
an attribute, which is a no-go due to the name collision thing...

Basically what we want here is an IDL attribute for which the getter 
returns one type but the setter takes a different type.  Or something. 
We can do it the way you proposed, but it seems like a workaround for 
the lack of ability to declare such a thing in WebIDL.

> Yes.  I presume same fear?

Yes.

-Boris




More information about the whatwg mailing list