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 API for postMessage with PostMessageOptions #1344

Closed
wants to merge 1 commit into from

Conversation

dtapuska
Copy link
Contributor

@dtapuska dtapuska commented Aug 10, 2018

This is similar to the HTML changes in whatwg/html#3800


Preview | Diff

@domenic
Copy link
Contributor

domenic commented Oct 26, 2018

The corresponding HTML changes have been merged.

docs/index.bs Outdated
@@ -309,6 +309,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state;
void postMessage(any message, optional sequence<object> transfer = []);
void postMessage(any message, PostMessageOptions options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be marked optional, the previous line should have its second argument marked as non-optional (and non-defaulting).

@dtapuska
Copy link
Contributor Author

@annevk changes made

@mfalken
Copy link
Member

mfalken commented Mar 7, 2019

Hi @dtapuska sorry that this never got merged. Can you rebase and reupload? You don't need the docs/index.html change, that gets generated automatically after you commit.

I could attempt to do this manually but I'm afraid the commit would lose attribution to you.

@annevk
Copy link
Member

annevk commented Mar 7, 2019

@mattto it shouldn't lose attribution. If it does, you can override the author explicitly using --author.

@dtapuska
Copy link
Contributor Author

dtapuska commented Mar 7, 2019

Rebased and forced pushed

@mfalken
Copy link
Member

mfalken commented Mar 8, 2019

Thanks all, I ended up doing the manual merge to drop the change to index.html. It landed in 3b31974 and I expect index.html to be generated automatically soon.

@mfalken mfalken closed this Mar 8, 2019
yury-s pushed a commit to yury-s/webkit-http that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants