Bug 29801

Summary: addEventListener of MessagePort should also call start(), like onmessage
Product: WebKit Reporter: Zoltan Herczeg <zherczeg>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
fix for calling the call start() sam: review-

Description Zoltan Herczeg 2009-09-28 02:33:53 PDT
My qestion is: should we do it all the time, or only when eventType is "message".
In case of the latter, where should I create a global string "message"?
Comment 1 Zoltan Herczeg 2009-09-28 03:37:22 PDT
Created attachment 40223 [details]
fix for calling the call start()
Comment 2 Sam Weinig 2009-09-28 09:57:16 PDT
This needs a regression test.
Comment 3 Alexey Proskuryakov 2009-09-28 10:18:32 PDT
Also, please explain why this should be so. I don't think the spec says that.
Comment 4 Zoltan Herczeg 2009-09-28 10:44:37 PDT
(In reply to comment #3)
> Also, please explain why this should be so. I don't think the spec says that.

See the SharedWorker example here: http://www.whatwg.org/specs/web-workers/current-work/

See the code example after "The viewer is more involved:"

worker.port.addEventListener('message', configure, false);

is used instead of

worker.port.onmessage = configure

Moreover, more addEventListener (4, exactly) is applied for one worker object (actually I didn't tested that, yet)

You think the example is wrong?

How can I make regression test for Shared Workers?
Comment 5 Alexey Proskuryakov 2009-09-28 11:05:16 PDT
> See the SharedWorker example here:
> http://www.whatwg.org/specs/web-workers/current-work/

The examples section is non-normative. We need to have this specified in normative text - I'd suggest e-mailing WhatWG mailing list about this issue.

> How can I make regression test for Shared Workers?

We have a number of tests for workers in LayoutTests/fast/workers, so you could use one of those as an example.
Comment 6 Zoltan Herczeg 2009-09-29 10:41:42 PDT
According to the discussion on whatwg (http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-September/023246.html), this bug turned out to be a feature. And they will probably change the example to call worker.start() after the listeners added.

I close this bug now. Days of debugging goes waste again. I am not a lucky person nowadays.