[whatwg] Workers and addEventListener

The intent of the spec is fairly clear that addEventListener("message")
should not start the message queue dispatch - only setting the onmessage
attribute does that:
The first time a MessagePort <#messageport> object's
onmessage<#handler-messageport-onmessage> IDL
attribute is set, the port's port message queue <#port-message-queue> must
be enabled, as if the start() <#dom-messageport-start> method had been
called.

In fact, the only reason for the existence of the MessagePort.start() method
is to enable applications to start message queue dispatch when using
addEventListener().

I don't have a strong opinion as to whether we should change the spec,
though. I suspect not, given Anne's email. We should instead change the
example in the workers spec to call start().

-atw

On Tue, Sep 29, 2009 at 2:13 AM, Anne van Kesteren <annevk at opera.com> wrote:

> On Tue, 29 Sep 2009 09:13:17 +0200, Zoltan Herczeg <
> zherczeg at inf.u-szeged.hu> wrote:
>
>> Anyway, my qestion is:
>>  - should addEventListener enable message transmitting?
>>  - Should it do it in all cases, or only when "message" is passed as the
>> first argument
>>
>
> I don't think it should. Web Workers should not modify the semantics of
> addEventListener.
>
>
> --
> Anne van Kesteren
> http://annevankesteren.nl/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090929/912dc2ca/attachment.htm>

Received on Tuesday, 29 September 2009 10:06:15 UTC