W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] Workers and addEventListener

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 15 Oct 2009 21:24:39 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0910152119120.6803@hixie.dreamhostps.com>
On Thu, 15 Oct 2009, Drew Wilson wrote:
>
> To be absolutely clear (since there's some confusion about whether we 
> are talking about explicit MessagePorts, or about implicit ports for 
> dedicated workers). Are you saying that this:
> 
> var channel = new MessageChannel();
> channel.port1.postMessage("hi mom");
> channel.port2.addEventListener("message", function(event)
> {alert(event.data); }, false);
> 
> Should result in an alert dialog being fired?

Nope, this case should not get an event fired.


> I would not be opposed to changing the spec to include enabling a port's 
> message queue when addEventListener("message") is invoked.

I'm reluctant to make addEventListener() do magic.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 15 October 2009 14:24:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC