W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Proposal to allow Transferables to be used in initMessageEvent

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 11 Aug 2011 22:51:55 +0000 (UTC)
To: Luke Zarko <zarko@google.com>
cc: public-webapps@w3.org
Message-ID: <Pine.LNX.4.64.1108112250330.9174@ps20323.dreamhostps.com>
On Tue, 9 Aug 2011, Luke Zarko wrote:
>
> I came across this while implementing support for the new 
> Transferable[1] interface for Chromium. initMessageEvent is defined[2] 
> as:
> 
>   void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, 
> in boolean cancelableArg, in any dataArg, in DOMString originArg, in 
> DOMString lastEventIdArg, in WindowProxy? sourceArg, in 
> sequence<MessagePort> portsArg);
> 
> However, postMessage is usually defined to take a sequence<Transferable> 
> [3]:
> 
>   void postMessage(in any message, in optional sequence<Transferable> 
> transfer);
> 
> I suggest changing initMessageEvent to permit arbitrary Transferables:

While it is possible for postMessage()'s second argument to take non-port 
Transferables (in particular ArrayBuffers), it's not possible for the 
generated event to contain those objects in the event.ports array, so 
there's no reason for the constructor to support that.


> Without this change, it is not possible for a JavaScript author to 
> directly construct a MessageEvent with a dataArg that contains 
> Transferable objects (other than MessagePorts).

Why not? The dataArg has type "any".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 11 August 2011 22:52:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:47 GMT