Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Window.postMessage override that takes a dictionary #3799

Closed
dtapuska opened this issue Jul 5, 2018 · 16 comments
Closed

Add Window.postMessage override that takes a dictionary #3799

dtapuska opened this issue Jul 5, 2018 · 16 comments
Labels
addition/proposal New features or enhancements

Comments

@dtapuska
Copy link
Contributor

dtapuska commented Jul 5, 2018

It is not possible to specify additional options to the postMessage method. I propose that we should change it so that it takes a dictionary.

Proposal from: https://github.com/dtapuska/useractivation

dictionary WindowPostMessageOptions {
  USVString targetOrigin = "/";
};

partial interface Window {
 void postMessage(any message, optional sequence<object> transfer = [],
                                optional WindowPostMessageOptions options);

};
@dtapuska
Copy link
Contributor Author

dtapuska commented Jul 5, 2018

Related issue is #1983

@domenic
Copy link
Member

domenic commented Jul 10, 2018

Folks, what do you think?

https://github.com/dtapuska/useractivation gives one motivation (see also #1983), wanting to add a new option to postMessage(). However, I'd argue that even without that motivation, this is a good idea for the platform and for web developers:

  • It makes it so that you can more consistently do X.postMessage(data, transfer_opt, options_opt) throughout the platform. Currently there are 7 postMessage APIs, and, infuriatingly, all of them except Window conform to this pattern.
  • It provides a nice safe default targetOrigin of "/", as opposed to the "*" I see recommended in lots of copy-and-paste-prone tutorials.
  • window.postMessage(data, [t], { targetOrigin: "https://example.com/" }) is much more understandable to the reader than window.postMessage(data, "https://example.com/", [t]).

/ccing @smaug---- as I know he's been looking at https://github.com/dtapuska/useractivation. Then @travisleithead and @hober for Edge and Safari?

(I realize some folks might not find the implementation cost of this change in and of itself compelling, and might need to first be convinced of the value and design choices in https://github.com/dtapuska/useractivation. That's fine too. But with my editor and web developer hats on, I really want this change, independent of any future options we add to this dictionary.)

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Jul 10, 2018
dtapuska added a commit to dtapuska/html that referenced this issue Jul 19, 2018
@dtapuska
Copy link
Contributor Author

@smaug---- @travisleithead @hober Any thoughts on this proposal?

@rniwa
Copy link

rniwa commented Jul 19, 2018

@cdumez

@smaug----
Copy link

smaug---- commented Jul 20, 2018

So far I haven't seen good reasoning why to change the old API.

@annevk
Copy link
Member

annevk commented Jul 23, 2018

Providing a consistent API is fairly compelling to me. I do wonder if requiring the transfer argument forever will turn out to be a mistake. That makes more sense as part of a dictionary to me.

@smaug----
Copy link

ok, fine, consistency would be good, and I agree transfer as a part of dictionary would be better, since it is often empty.

dtapuska added a commit to dtapuska/html that referenced this issue Jul 24, 2018
@dtapuska
Copy link
Contributor Author

@annevk @smaug---- how does the latest revision look?

@annevk
Copy link
Member

annevk commented Jul 26, 2018

@dtapuska I haven't reviewed in detail, but that looks okay to me. I was worried that sequence and dictionary would not be https://heycam.github.io/webidl/#dfn-distinguishable but it seems they are so the other postMessage() methods could be similarly overloaded.

@cdumez
Copy link

cdumez commented Jul 26, 2018

So is the latest proposal:

partial interface Window {
  void postMessage(any message, optional sequence<object> transfer = [], optional WindowPostMessageOptions options);
};

or

partial interface Window {
  void postMessage(any message, optional WindowPostMessageOptions options);
};

with transfer being part of the options dictionary?

The previous comment from @smaug---- seemed to be in favor of making transfer part of the dictionary since it is optional and often empty. However, if we do so, then Window's postMessage is no longer consistent with other postMessage APIs, is it? It seemed like some people wanted that.

Personally, I do not believe that the consistency argument alone would be worth the trouble to implement this. I get that switching to a dictionary would be good if we added more options. However, we are currently not adding any options, are we? My preference would be to hold off on making a switch to dictionary until we actually need it (because we're adding options). It is unclear to me what those options will be (all other postMessage APIs do not require any options).

@dtapuska
Copy link
Contributor Author

The current pull request is the later (transfer inside dictionary). If you see the user activation proposal that will be the dictionary entry we wish to add. But we've disassociated it from this post message change.

@smaug----
Copy link

If we do this, all the postMessages should have (any message, optional PostMessageOptions options) form.

@dtapuska
Copy link
Contributor Author

That's fine. I can make pull requests against the other specs tomorrow if we agree on this.

dtapuska added a commit to dtapuska/html that referenced this issue Jul 30, 2018
@dtapuska
Copy link
Contributor Author

@domenic I think I got the other spots. WDYT?

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
aarongable pushed a commit to chromium/chromium that referenced this issue Jul 30, 2018
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579152}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579152}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579152}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 3, 2018
…MessageOptions, a=testonly

Automatic update from web-platform-testsMove the transfer object into WindowPostMessageOptions

Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579152}

--

wpt-commits: defe19d91c59decb804193cbc0137e6a8465367a
wpt-pr: 12212
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Aug 3, 2018
…MessageOptions, a=testonly

Automatic update from web-platform-testsMove the transfer object into WindowPostMessageOptions

Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579152}

--

wpt-commits: defe19d91c59decb804193cbc0137e6a8465367a
wpt-pr: 12212
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 8, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Add a PostMessgeOptions dictionary so that WindowPostMessageOptions is
a subclass of that.

BUG=861735

Change-Id: I66c6990de82b0d74efa7f31240b63d19d074945d
Reviewed-on: https://chromium-review.googlesource.com/1165954
Reviewed-by: David Bokan <[email protected]>
Commit-Queue: Dave Tapuska <[email protected]>
Cr-Commit-Position: refs/heads/master@{#581417}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 9, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 10, 2018
In anticipation of adding a few more overloads to the postMessage APIs
in whatwg/html#3799 ensure that the code doesn't
use the PostMessage extended attribute. Since the extended attribute doesn't support
overloading it was decided that these implementations should really be
reading the transferable argument themselves not in the bindings code.

Make two versions one that is used by service workers that causes
transferables to be copied and another that is used by workers,
and message_ports that treat them as moveable types.

BUG=861735

Change-Id: I82720aae73a1285d74b5c8f10b244c719290e2d9
Reviewed-on: https://chromium-review.googlesource.com/1165835
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Hitoshi Yoshida <[email protected]>
Reviewed-by: Yuki Shiino <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582127}
dtapuska added a commit to dtapuska/html that referenced this issue Aug 10, 2018
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 10, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 13, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 13, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582619}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 13, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582619}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 13, 2018
The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582619}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 15, 2018
…and message_port, a=testonly

Automatic update from web-platform-testsAdd a PostMessageOptions API to workers and message_port

The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582619}

--

wpt-commits: aaac36358ac55215fbb28d62d235470859001e91
wpt-pr: 12385
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Aug 15, 2018
…and message_port, a=testonly

Automatic update from web-platform-testsAdd a PostMessageOptions API to workers and message_port

The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#582619}

--

wpt-commits: aaac36358ac55215fbb28d62d235470859001e91
wpt-pr: 12385
@foolip
Copy link
Member

foolip commented Aug 17, 2018

(I came here from Intent to Implement and Ship: PostMessageOptions and WindowPostMessageOptions dictionary for postMessage methods)

My preference would be to hold off on making a switch to dictionary until we actually need it (because we're adding options). It is unclear to me what those options will be (all other postMessage APIs do not require any options).

@cdumez, the intended addition is https://github.com/dtapuska/useractivation. The relevant bit there is the includeUserActivation member.

dtapuska added a commit to dtapuska/html that referenced this issue Sep 6, 2018
@travisleithead
Copy link
Member

Late reply, but I support this--also glad to see transfer included in the dictionary as param 2.

@domenic domenic removed the needs implementer interest Moving the issue forward requires implementers to express interest label Sep 28, 2018
dtapuska added a commit to dtapuska/html that referenced this issue Oct 2, 2018
domenic pushed a commit to dtapuska/html that referenced this issue Oct 26, 2018
mustaqahmed pushed a commit to mustaqahmed/html that referenced this issue Feb 15, 2019
mustaqahmed pushed a commit to mustaqahmed/html that referenced this issue Feb 15, 2019
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…MessageOptions, a=testonly

Automatic update from web-platform-testsMove the transfer object into WindowPostMessageOptions

Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#579152}

--

wpt-commits: defe19d91c59decb804193cbc0137e6a8465367a
wpt-pr: 12212

UltraBlame original commit: 5b3dd8affc580fc17e73cfc4ecc554069ae41d71
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…MessageOptions, a=testonly

Automatic update from web-platform-testsMove the transfer object into WindowPostMessageOptions

Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#579152}

--

wpt-commits: defe19d91c59decb804193cbc0137e6a8465367a
wpt-pr: 12212

UltraBlame original commit: 5b3dd8affc580fc17e73cfc4ecc554069ae41d71
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…and message_port, a=testonly

Automatic update from web-platform-testsAdd a PostMessageOptions API to workers and message_port

The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Reviewed-by: Kentaro Hara <harakenchromium.org>
Cr-Commit-Position: refs/heads/master{#582619}

--

wpt-commits: aaac36358ac55215fbb28d62d235470859001e91
wpt-pr: 12385

UltraBlame original commit: 8a49d6c83ccbfad19178a65c50d5feccfaa578d3
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…and message_port, a=testonly

Automatic update from web-platform-testsAdd a PostMessageOptions API to workers and message_port

The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Reviewed-by: Kentaro Hara <harakenchromium.org>
Cr-Commit-Position: refs/heads/master{#582619}

--

wpt-commits: aaac36358ac55215fbb28d62d235470859001e91
wpt-pr: 12385

UltraBlame original commit: 8a49d6c83ccbfad19178a65c50d5feccfaa578d3
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…MessageOptions, a=testonly

Automatic update from web-platform-testsMove the transfer object into WindowPostMessageOptions

Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#579152}

--

wpt-commits: defe19d91c59decb804193cbc0137e6a8465367a
wpt-pr: 12212

UltraBlame original commit: 5b3dd8affc580fc17e73cfc4ecc554069ae41d71
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…and message_port, a=testonly

Automatic update from web-platform-testsAdd a PostMessageOptions API to workers and message_port

The current pull request against the HTML spec is here:
whatwg/html#3799

Rename the RuntimeEnabledFeature from WindowPostMessageOptions to
PostMessageOptions

BUG=861735

Change-Id: Ia7980a85c10535f6d531c87f3790efcf6ed2d54d
Reviewed-on: https://chromium-review.googlesource.com/1169304
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Reviewed-by: Kentaro Hara <harakenchromium.org>
Cr-Commit-Position: refs/heads/master{#582619}

--

wpt-commits: aaac36358ac55215fbb28d62d235470859001e91
wpt-pr: 12385

UltraBlame original commit: 8a49d6c83ccbfad19178a65c50d5feccfaa578d3
yury-s pushed a commit to yury-s/webkit-http that referenced this issue Dec 13, 2019
https://bugs.webkit.org/show_bug.cgi?id=191028

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that we have more passes.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/windows/document-access/document_access_parent_access.tentative-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt:
* web-platform-tests/webmessaging/message-channels/dictionary-transferrable-expected.txt:
* web-platform-tests/webmessaging/message-channels/user-activation.tentative-expected.txt:
* web-platform-tests/webmessaging/postMessage_MessagePorts_xsite.sub.window-expected.txt:
* web-platform-tests/webmessaging/with-options/host-specific-origin-expected.txt:
* web-platform-tests/webmessaging/with-options/message-channel-transferable-expected.txt:
* web-platform-tests/webmessaging/with-options/no-target-origin-expected.txt:
* web-platform-tests/webmessaging/with-options/null-transfer-expected.txt:
* web-platform-tests/webmessaging/with-options/one-arg-expected.txt:
* web-platform-tests/webmessaging/with-options/slash-origin-expected.txt:
* web-platform-tests/webmessaging/with-options/undefined-transferable-expected.txt:
* web-platform-tests/webmessaging/with-options/unknown-parameter-expected.txt:
* web-platform-tests/webmessaging/without-ports/008-expected.txt:
* web-platform-tests/webmessaging/worker_postMessage_user_activation.tentative-expected.txt:
* web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-dictionary-expected.txt:
* web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-expected.txt:

Source/WebCore:

Implement PostMessageOptions dictionary parameter for postMessage:
- whatwg/html#3799
- w3c/ServiceWorker#1344

Blink and Gecko already support this.

No new tests, rebaselined existing tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
* dom/MessagePort.h:
* dom/MessagePort.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
(WebCore::WindowPostMessageOptions::WindowPostMessageOptions):
* page/DOMWindow.idl:
* page/PostMessageOptions.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
(WebCore::PostMessageOptions::PostMessageOptions):
* page/PostMessageOptions.idl: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/Worker.h:
* workers/Worker.idl:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorker.idl:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClient.idl:

LayoutTests:

Update a few existing tests due to the behavior change.

* TestExpectations:
* fast/dom/Window/post-message-crash.html:
* fast/events/message-port-multi-expected.txt:
* fast/events/resources/message-port-multi.js:
* fast/workers/resources/worker-context-thread-multi-port.js:
* fast/workers/resources/worker-multi-port.js:
* fast/workers/worker-multi-port-expected.txt:
* http/tests/security/postMessage/target-origin-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements
Development

No branches or pull requests

8 participants