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"?
Created attachment 40223 [details] fix for calling the call start()
This needs a regression test.
Also, please explain why this should be so. I don't think the spec says that.
(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?
> 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.
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.