[whatwg] [Bug 12287] Restrict sequence<T> to operation argument types and return types

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12287:
> sequence<T> has undesirable behaviour in JS when used as an attribute
> value, so we should consider preventing its use there.

HTML5 Section 10:
> typedef sequence<MessagePort> MessagePortArray;
>
> interface MessageEvent : Event {
>   readonly attribute any data;
>   readonly attribute DOMString origin;
>   readonly attribute DOMString lastEventId;
>   readonly attribute WindowProxy source;
>   readonly attribute MessagePortArray ports;
>   void initMessageEvent(...);
> };

The WebIDL specification has been changed so the MessageEvent interface in
HTML5 is no longer valid.  This only appears to have been implemented by
Opera at the moment, and it returns the same ECMAScript Array every time it
is called.  I would guess this can still be changed given that it is not
widely implemented.

Can MessagePortArray be changed to be some kind of collection like many of
the other places in DOM when we want a list of children?  This would probably
be easiest for me, but perhaps there is a better way.

Received on Monday, 23 May 2011 02:04:54 UTC