Bug 66713 - postMessage to raises INVALID_STATE_ERR instead of DATA_CLONE_ERR in many cases.
Summary: postMessage to raises INVALID_STATE_ERR instead of DATA_CLONE_ERR in many cases.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks: 65209
  Show dependency treegraph
 
Reported: 2011-08-22 14:32 PDT by David Levin
Modified: 2011-08-29 10:59 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.70 KB, patch)
2011-08-22 16:37 PDT, David Levin
no flags Details | Formatted Diff | Diff
Patch (14.28 KB, patch)
2011-08-24 15:49 PDT, David Levin
dimich: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2011-08-22 14:32:50 PDT
Bring our implementation in alignment with the current spec.
Comment 1 David Levin 2011-08-22 16:37:36 PDT
Created attachment 104763 [details]
Patch
Comment 2 David Levin 2011-08-23 11:55:43 PDT
Comment on attachment 104763 [details]
Patch

Need to add the new chromium results.
Comment 3 David Levin 2011-08-24 15:49:46 PDT
Created attachment 105088 [details]
Patch
Comment 4 Dmitry Titov 2011-08-24 16:20:27 PDT
It is a change in behavior. Although likely not a big compat issue, but what do the FF and IE throw in those cases?
Comment 5 David Levin 2011-08-25 11:26:51 PDT
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 6 Dmitry Titov 2011-08-25 11:42:12 PDT
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
Comment 7 David Levin 2011-08-29 10:59:05 PDT
Committed as http://trac.webkit.org/changeset/93986