Bring our implementation in alignment with the current spec.
Created attachment 104763 [details] Patch
Comment on attachment 104763 [details] Patch Need to add the new chromium results.
Created attachment 105088 [details] Patch
It is a change in behavior. Although likely not a big compat issue, but what do the FF and IE throw in those cases?
it seems that neither Windows Internet Explorer 10 platform preview 2 edition (WIE10PP2E) nor Firefox nightly implement MessageChannel yet (http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#message-channels). But I did alternate tests. For Firefox, I did something like this: var w = new Worker(location.href); w.postMessage(document); It resulted in a data clone error. (Adding a port argument didn't work because it seems that they don't support this yet.) For WIE10PP2E, var w = new Worker(location.href); w.postMessage("hi", [null]); resulted in invalid state error and var w = new Worker(location.href); w.postMessage(document); resulted in an obscure hresult being returned. So in short FireFox throws a data clone error. WIE10PP2E returns invalid state at the moment but they were released before the spec changed to this. Regardless, these errors should only happen when there is a developer programming error, so I'm pretty doubtful that this will be an error condition that folks are trying to handle.
Comment on attachment 105088 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105088&action=review r=me with a nit. > LayoutTests/ChangeLog:3 > + postMessage to raises INVALID_STATE_ERR instead of DATA_CLONE_ERR in many cases. "to raises" -> "to raise"? > Source/WebCore/ChangeLog:3 > + postMessage to raises INVALID_STATE_ERR instead of DATA_CLONE_ERR in many cases. same as above
Committed as http://trac.webkit.org/changeset/93986