This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13232 - I think the section on DedicatedWorkerScope should include information about the kinds of data that postMessage can send to a worker, and the kinds of data that a worker can send back. http://dev.w3.org/html5/workers/#dedicated-workers-and-the-dedicatedwo
Summary: I think the section on DedicatedWorkerScope should include information about ...
Status: CLOSED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Web Workers (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 18:15 UTC by contributor
Modified: 2011-08-19 20:54 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2011-07-13 18:15:37 UTC
Specification: http://dev.w3.org/html5/workers/#handler-dedicatedworkerglobalscope-onmessage
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
I think the section on DedicatedWorkerScope should include information about
the kinds of data that postMessage can send to a worker, and the kinds of data
that a worker can send back.

http://dev.w3.org/html5/workers/#dedicated-workers-and-the-dedicatedworkerglob
alscope-interface

For instance: where does it say, you can send numbers, strings, etc. to a
work? JSON? etc. ?? I think that information should be included in this
document. 

Posted from: 174.21.152.161
User agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
Comment 1 Travis Leithead [MSFT] 2011-07-26 17:39:18 UTC
"The postMessage() method on [..] objects must act as if, when invoked, it immediately invoked the method of the same name on the port, with the same arguments, and returned the same return value."

This should lead the reader to the definition of MessagePort in the Web Messaging spec, but unfortunately, the Web Messaging spec is not referenced by the Web Workers spec ??

Once the reader is looking at Web Messaging, the can discover the structured clone technique for passing data:

"6.Let message clone be the result of obtaining a structured clone of the message argument, with transfer map as the transfer map. If this throws an exception, then throw that exception and abort these steps."
[http://dev.w3.org/html5/postmsg/#posting-messages]

Of course, then the reader needs to crack the HTML spec itself to find the algorithm.

I think a reference to the Web Messaging spec would be sufficient to resolve this bug.
Comment 2 Ian 'Hixie' Hickson 2011-08-08 20:10:13 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 3 contributor 2011-08-08 20:10:28 UTC
Checked in as WHATWG revision r6384.
Check-in comment: Give more explanation about how workers work.
http://html5.org/tools/web-apps-tracker?from=6383&to=6384