According to the specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#dom-window-postmessage If the method was invoked with a second argument transfer then if any of the objects in the transfer are either the source port or the target port (if any), then a DataCloneError exception should be thrown. Currently an InvalidStateError exception is thrown what is an incorrect behaviour.
Created attachment 217547 [details] Proposed patch
Comment on attachment 217547 [details] Proposed patch Attachment 217547 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/30528006 New failing tests: fast/events/message-port-clone.html fast/events/message-port-multi.html
Created attachment 217550 [details] Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-10 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 217547 [details] Proposed patch Attachment 217547 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/31728042 New failing tests: fast/events/message-port-clone.html fast/events/message-port-multi.html
Created attachment 217553 [details] Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 217781 [details] Path
Created attachment 217782 [details] Proposed Path 2
Comment on attachment 217782 [details] Proposed Path 2 View in context: https://bugs.webkit.org/attachment.cgi?id=217782&action=review Seems fine to make this change. > LayoutTests/http/tests/security/postMessage/postMessage-clone-port-error.html:3 > +<script src="../../../../resources/js-test-pre.js"></script> In HTTP tests, you don't need to use relative paths, can be just "/resources/js-test-pre.js". But then I'm not sure why this is an HTTP test. Can it be a regular one? It's better to make non-HTTP tests when possible, because HTTP tests are slower. > LayoutTests/http/tests/security/postMessage/postMessage-clone-port-error.html:23 > +</html> You should also include js-test-post.js - it signals that a test has been run in full.
Created attachment 218577 [details] Patch no 3
> You should also include js-test-post.js - it signals that a test has been run in full. This still needs to be done.
Created attachment 218730 [details] Patch no 4
Comment on attachment 218730 [details] Patch no 4 Clearing flags on attachment: 218730 Committed r160309: <http://trac.webkit.org/changeset/160309>
Comment on attachment 218730 [details] Patch no 4 View in context: https://bugs.webkit.org/attachment.cgi?id=218730&action=review > LayoutTests/fast/dom/Window/postMessage-clone-port-error-expected.txt:4 > +PASS successfullyParsed is true > + > +TEST COMPLETE > +PASS exName is "DataCloneError" These results are broken, TEST COMPLETE should be the last line.
The issue related to the test expectation order will be improved in an external issue: https://bugs.webkit.org/show_bug.cgi?id=125487
The issue is resolved.