Diff
Modified: trunk/LayoutTests/ChangeLog (253496 => 253497)
--- trunk/LayoutTests/ChangeLog 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/ChangeLog 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,23 @@
+2019-12-13 Chris Dumez <[email protected]>
+
+ Implement PostMessageOptions for postMessage
+ https://bugs.webkit.org/show_bug.cgi?id=191028
+
+ Reviewed by Alex Christensen.
+
+ 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:
+
2019-12-13 Charlie Turner <[email protected]>
[GStreamer][EME] Update expectation for media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
Modified: trunk/LayoutTests/TestExpectations (253496 => 253497)
--- trunk/LayoutTests/TestExpectations 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/TestExpectations 2019-12-13 21:36:25 UTC (rev 253497)
@@ -210,6 +210,9 @@
# Per specification, if the scripts are identical, we do not install the new script and return the existing registration.
imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-redirect.https.html [ Skip ]
+# This test is timing out in all browsers.
+imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https.html [ Skip ]
+
imported/w3c/web-platform-tests/referrer-policy [ Skip ]
# Newly imported service worker tests that are timing out.
Modified: trunk/LayoutTests/fast/dom/Window/post-message-crash.html (253496 => 253497)
--- trunk/LayoutTests/fast/dom/Window/post-message-crash.html 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/dom/Window/post-message-crash.html 2019-12-13 21:36:25 UTC (rev 253497)
@@ -14,15 +14,24 @@
var n = 0;
-window._onerror_ = function() {
+function finishIfNeeded()
+{
if (++n === 2) {
document.querySelector('pre').textContent = 'PASS';
if (window.testRunner)
testRunner.notifyDone();
}
+}
+
+window._onerror_ = function() {
+ finishIfNeeded();
return true;
};
+_onmessage_ = () => {
+ finishIfNeeded();
+}
+
requestAnimationFrame(postMessage);
setTimeout(postMessage);
Modified: trunk/LayoutTests/fast/events/message-port-multi-expected.txt (253496 => 253497)
--- trunk/LayoutTests/fast/events/message-port-multi-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/events/message-port-multi-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -8,7 +8,7 @@
PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception TypeError: Type error.
PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception DataCloneError: The object can not be cloned..
PASS channel.port1.postMessage("duplicate port", [channel3.port1, channel3.port1]) threw exception DataCloneError: The object can not be cloned..
-PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: Type error.
+PASS channel.port1.postMessage("notAnArray", "foo") threw exception TypeError: Type error.
PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception DataCloneError: The object can not be cloned..
PASS channel.port1.postMessage("largeSequence", largePortArray) threw exception TypeError: Type error.
PASS event.ports is non-null and zero length when no port sent
Modified: trunk/LayoutTests/fast/events/resources/message-port-multi.js (253496 => 253497)
--- trunk/LayoutTests/fast/events/resources/message-port-multi.js 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/events/resources/message-port-multi.js 2019-12-13 21:36:25 UTC (rev 253497)
@@ -23,7 +23,7 @@
// Should be OK to send channel3.port1 (should not have been disentangled by the previous failed calls).
channel.port1.postMessage("entangled ports", [channel3.port1, channel3.port2]);
-shouldThrow('channel.port1.postMessage("notAnArray", channel3.port1)')
+shouldThrow('channel.port1.postMessage("notAnArray", "foo")')
shouldThrow('channel.port1.postMessage("notASequence", [{length: 3}])');
// Should not crash (we should figure out that the array contains undefined
Modified: trunk/LayoutTests/fast/workers/resources/worker-context-thread-multi-port.js (253496 => 253497)
--- trunk/LayoutTests/fast/workers/resources/worker-context-thread-multi-port.js 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/workers/resources/worker-context-thread-multi-port.js 2019-12-13 21:36:25 UTC (rev 253497)
@@ -28,7 +28,7 @@
}
try {
- postMessage("notAnArray", channel3.port1);
+ postMessage("notAnArray", "foo");
testFailed("posting a non-array should throw");
} catch (e) {
testPassed("posting a non-array did throw: " + e);
Modified: trunk/LayoutTests/fast/workers/resources/worker-multi-port.js (253496 => 253497)
--- trunk/LayoutTests/fast/workers/resources/worker-multi-port.js 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/workers/resources/worker-multi-port.js 2019-12-13 21:36:25 UTC (rev 253497)
@@ -21,7 +21,7 @@
// Should be OK to send channel3.port1/2 (should not have been disentangled by the previous failed calls).
worker.postMessage("failed ports", [channel3.port1, channel3.port2]);
-shouldThrow('worker.postMessage("notAnArray", channel3.port1)')
+shouldThrow('worker.postMessage("notAnArray", "foo")')
shouldThrow('worker.postMessage("notASequence", [{length: 3}])');
worker.postMessage("done", [channel.port2]);
Modified: trunk/LayoutTests/fast/workers/worker-multi-port-expected.txt (253496 => 253497)
--- trunk/LayoutTests/fast/workers/worker-multi-port-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/fast/workers/worker-multi-port-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -5,7 +5,7 @@
PASS worker.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception TypeError: Type error.
PASS worker.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception DataCloneError: The object can not be cloned..
-PASS worker.postMessage("notAnArray", channel3.port1) threw exception TypeError: Type error.
+PASS worker.postMessage("notAnArray", "foo") threw exception TypeError: Type error.
PASS worker.postMessage("notASequence", [{length: 3}]) threw exception DataCloneError: The object can not be cloned..
PASS event.ports is non-null and zero length when no port sent
PASS event.ports is non-null and zero length when empty array sent
Modified: trunk/LayoutTests/http/tests/security/postMessage/target-origin-expected.txt (253496 => 253497)
--- trunk/LayoutTests/http/tests/security/postMessage/target-origin-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/http/tests/security/postMessage/target-origin-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -10,11 +10,13 @@
CONSOLE MESSAGE: Unable to post message to http://www.example.com. Recipient has origin http://localhost:8000.
+CONSOLE MESSAGE: Unable to post message to http://127.0.0.1:8000. Recipient has origin http://localhost:8000.
+
+CONSOLE MESSAGE: Unable to post message to http://127.0.0.1:8000. Recipient has origin http://localhost:8000.
+
window.location.href = ""
waiting...
-Error sending message to null. SyntaxError: The string did not match the expected pattern.
-Error sending message to undefined. SyntaxError: The string did not match the expected pattern.
Error sending message to //. SyntaxError: The string did not match the expected pattern.
Received message: data="" message: data="" origin=http://localhost:8000" origin="http://127.0.0.1:8000"" origin="http://localhost:8000"
Received message: data="" message: data="" origin=http://localhost:8000/" origin="http://127.0.0.1:8000"" origin="http://localhost:8000"
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,5 +1,34 @@
2019-12-13 Chris Dumez <[email protected]>
+ Implement PostMessageOptions for postMessage
+ https://bugs.webkit.org/show_bug.cgi?id=191028
+
+ Reviewed by Alex Christensen.
+
+ 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:
+
+2019-12-13 Chris Dumez <[email protected]>
+
REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205164
<rdar://problem/57879042>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -3,15 +3,21 @@
CONSOLE MESSAGE: line 302: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://127.0.0.1:8800". Protocols, domains, and ports must match.
CONSOLE MESSAGE: line 287: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://localhost:8800". The frame being accessed set "document.domain" to "localhost", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access.
CONSOLE MESSAGE: line 302: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://localhost:8800". The frame being accessed set "document.domain" to "localhost", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access.
+CONSOLE MESSAGE: line 302: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://localhost:8800". The frame being accessed set "document.domain" to "localhost", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access.
CONSOLE MESSAGE: line 287: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://127.0.0.1:8800". Protocols, domains, and ports must match.
CONSOLE MESSAGE: line 302: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://127.0.0.1:8800". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 302: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://127.0.0.1:8800". Protocols, domains, and ports must match.
CONSOLE MESSAGE: Unable to post message to http://does-not.exist. Recipient has origin http://127.0.0.1:8800.
+CONSOLE MESSAGE: Unable to post message to http://localhost:8800. Recipient has origin http://127.0.0.1:8800.
+
CONSOLE MESSAGE: Unable to post message to http://does-not.exist. Recipient has origin http://localhost:8800.
CONSOLE MESSAGE: Unable to post message to http://does-not.exist. Recipient has origin http://127.0.0.1:8800.
+CONSOLE MESSAGE: Unable to post message to http://localhost:8800. Recipient has origin http://127.0.0.1:8800.
+
PASS Basic sanity-checking (cross-origin)
PASS Basic sanity-checking (same-origin + document.domain)
PASS Basic sanity-checking (cross-site)
@@ -18,9 +24,9 @@
PASS Only whitelisted properties are accessible cross-origin (cross-origin)
PASS Only whitelisted properties are accessible cross-origin (same-origin + document.domain)
PASS Only whitelisted properties are accessible cross-origin (cross-site)
-FAIL Only whitelisted properties are usable as cross-origin this objects (cross-origin) promise_test: Unhandled rejection with value: object "SyntaxError: The string did not match the expected pattern."
-FAIL Only whitelisted properties are usable as cross-origin this objects (same-origin + document.domain) promise_test: Unhandled rejection with value: object "SyntaxError: The string did not match the expected pattern."
-FAIL Only whitelisted properties are usable as cross-origin this objects (cross-site) promise_test: Unhandled rejection with value: object "SyntaxError: The string did not match the expected pattern."
+PASS Only whitelisted properties are usable as cross-origin this objects (cross-origin)
+PASS Only whitelisted properties are usable as cross-origin this objects (same-origin + document.domain)
+PASS Only whitelisted properties are usable as cross-origin this objects (cross-site)
PASS [[GetPrototypeOf]] should return null (cross-origin)
PASS [[GetPrototypeOf]] should return null (same-origin + document.domain)
PASS [[GetPrototypeOf]] should return null (cross-site)
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/document_access_parent_access.tentative-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/document_access_parent_access.tentative-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/document_access_parent_access.tentative-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 2: TypeError: Not enough arguments
FAIL document_access_parent_access assert_equals: Security Error thrown expected "SecurityError" but got "ReferenceError"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -4180,8 +4180,8 @@
PASS Window interface: operation confirm(DOMString)
PASS Window interface: operation prompt(DOMString, DOMString)
PASS Window interface: operation print()
-FAIL Window interface: operation postMessage(any, USVString, [object Object]) assert_equals: property has wrong .length expected 1 but got 2
-FAIL Window interface: operation postMessage(any, WindowPostMessageOptions) assert_equals: property has wrong .length expected 1 but got 2
+PASS Window interface: operation postMessage(any, USVString, [object Object])
+PASS Window interface: operation postMessage(any, WindowPostMessageOptions)
PASS Window interface: operation captureEvents()
PASS Window interface: operation releaseEvents()
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,5 @@
-FAIL Test Clients.matchAll() promise_test: Unhandled rejection with value: object "TypeError: Not enough arguments"
+Harness Error (TIMEOUT), message = null
+TIMEOUT Test Clients.matchAll() Test timed out
+
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -2,6 +2,6 @@
PASS postMessage to a ServiceWorker (and back via MessagePort)
PASS postMessage a transferable ArrayBuffer between ServiceWorker and Client
PASS postMessage a transferable ArrayBuffer between ServiceWorker and Client over MessagePort
-FAIL postMessage with dictionary a transferable ArrayBuffer between ServiceWorker and Client promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS postMessage with dictionary a transferable ArrayBuffer between ServiceWorker and Client
PASS postMessage to a redundant worker
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/dictionary-transferrable-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/dictionary-transferrable-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/dictionary-transferrable-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL basic messagechannel with transfer Type error
+PASS basic messagechannel with transfer
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/user-activation.tentative-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/user-activation.tentative-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/user-activation.tentative-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL user activation messagechannel test Type error
+FAIL user activation messagechannel test undefined is not an object (evaluating 'e.userActivation.isActive')
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_MessagePorts_xsite.sub.window-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_MessagePorts_xsite.sub.window-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_MessagePorts_xsite.sub.window-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL Test Description: postMessage to cross-site iframe with MessagePort array containing 100 ports. The string did not match the expected pattern.
+PASS Test Description: postMessage to cross-site iframe with MessagePort array containing 100 ports.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/host-specific-origin-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/host-specific-origin-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/host-specific-origin-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL resolving url with stuff in host-specific The string did not match the expected pattern.
+PASS resolving url with stuff in host-specific
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/message-channel-transferable-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/message-channel-transferable-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/message-channel-transferable-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL MessageChannel's ports as MessagePort objects The string did not match the expected pattern.
+PASS MessageChannel's ports as MessagePort objects
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/no-target-origin-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/no-target-origin-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/no-target-origin-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL no targetOrigin The string did not match the expected pattern.
+PASS no targetOrigin
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/null-transfer-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/null-transfer-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/null-transfer-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL null transfer assert_throws: function "() => postMessage('', {transfer: null})" threw object "SyntaxError: The string did not match the expected pattern." ("SyntaxError") expected object "TypeError" ("TypeError")
+PASS null transfer
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/one-arg-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/one-arg-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/one-arg-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL just one argument Not enough arguments
+PASS just one argument
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/slash-origin-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/slash-origin-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/slash-origin-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL special value '/' The string did not match the expected pattern.
+PASS special value '/'
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/undefined-transferable-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/undefined-transferable-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/undefined-transferable-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL undefined as transferable The string did not match the expected pattern.
+PASS undefined as transferable
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/unknown-parameter-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/unknown-parameter-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/unknown-parameter-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL unknown parameter The string did not match the expected pattern.
+PASS unknown parameter
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/008-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/008-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/008-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL just one argument Not enough arguments
+PASS just one argument
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/worker_postMessage_user_activation.tentative-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/worker_postMessage_user_activation.tentative-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/worker_postMessage_user_activation.tentative-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL Post Message from a worker promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Post Message from a worker assert_equals: expected false but got true
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-dictionary-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-dictionary-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-dictionary-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL Using dictionary as postMessage's second argument Type error
+PASS Using dictionary as postMessage's second argument
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-expected.txt (253496 => 253497)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,3 @@
-FAIL Using null in postMessage's second argument assert_equals: expected (boolean) true but got (number) 1
+PASS Using null in postMessage's second argument
Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -4170,8 +4170,8 @@
PASS Window interface: operation confirm(DOMString)
PASS Window interface: operation prompt(DOMString, DOMString)
PASS Window interface: operation print()
-FAIL Window interface: operation postMessage(any, USVString, [object Object]) assert_equals: property has wrong .length expected 1 but got 2
-FAIL Window interface: operation postMessage(any, WindowPostMessageOptions) assert_equals: property has wrong .length expected 1 but got 2
+PASS Window interface: operation postMessage(any, USVString, [object Object])
+PASS Window interface: operation postMessage(any, WindowPostMessageOptions)
PASS Window interface: operation captureEvents()
PASS Window interface: operation releaseEvents()
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -4180,8 +4180,8 @@
PASS Window interface: operation confirm(DOMString)
PASS Window interface: operation prompt(DOMString, DOMString)
PASS Window interface: operation print()
-FAIL Window interface: operation postMessage(any, USVString, [object Object]) assert_equals: property has wrong .length expected 1 but got 2
-FAIL Window interface: operation postMessage(any, WindowPostMessageOptions) assert_equals: property has wrong .length expected 1 but got 2
+PASS Window interface: operation postMessage(any, USVString, [object Object])
+PASS Window interface: operation postMessage(any, WindowPostMessageOptions)
PASS Window interface: operation captureEvents()
PASS Window interface: operation releaseEvents()
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (253496 => 253497)
--- trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -4180,8 +4180,8 @@
PASS Window interface: operation confirm(DOMString)
PASS Window interface: operation prompt(DOMString, DOMString)
PASS Window interface: operation print()
-FAIL Window interface: operation postMessage(any, USVString, [object Object]) assert_equals: property has wrong .length expected 1 but got 2
-FAIL Window interface: operation postMessage(any, WindowPostMessageOptions) assert_equals: property has wrong .length expected 1 but got 2
+PASS Window interface: operation postMessage(any, USVString, [object Object])
+PASS Window interface: operation postMessage(any, WindowPostMessageOptions)
PASS Window interface: operation captureEvents()
PASS Window interface: operation releaseEvents()
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
Modified: trunk/Source/WebCore/CMakeLists.txt (253496 => 253497)
--- trunk/Source/WebCore/CMakeLists.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/CMakeLists.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -960,6 +960,7 @@
page/PerformanceResourceTiming.idl
page/PerformanceServerTiming.idl
page/PerformanceTiming.idl
+ page/PostMessageOptions.idl
page/RemoteDOMWindow.idl
page/ResizeObserver.idl
page/ResizeObserverCallback.idl
Modified: trunk/Source/WebCore/ChangeLog (253496 => 253497)
--- trunk/Source/WebCore/ChangeLog 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/ChangeLog 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1,3 +1,54 @@
+2019-12-13 Chris Dumez <[email protected]>
+
+ Implement PostMessageOptions for postMessage
+ https://bugs.webkit.org/show_bug.cgi?id=191028
+
+ Reviewed by Alex Christensen.
+
+ Implement PostMessageOptions dictionary parameter for postMessage:
+ - https://github.com/whatwg/html/issues/3799
+ - https://github.com/w3c/ServiceWorker/pull/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:
+
2019-12-13 Wenson Hsieh <[email protected]>
Implement encoding/decoding for DisplayList::DrawNativeImage
Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (253496 => 253497)
--- trunk/Source/WebCore/DerivedSources-input.xcfilelist 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist 2019-12-13 21:36:25 UTC (rev 253497)
@@ -914,6 +914,7 @@
$(PROJECT_DIR)/page/PerformanceResourceTiming.idl
$(PROJECT_DIR)/page/PerformanceServerTiming.idl
$(PROJECT_DIR)/page/PerformanceTiming.idl
+$(PROJECT_DIR)/page/PostMessageOptions.idl
$(PROJECT_DIR)/page/RemoteDOMWindow.idl
$(PROJECT_DIR)/page/ResizeObserver.idl
$(PROJECT_DIR)/page/ResizeObserverCallback.idl
Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (253496 => 253497)
--- trunk/Source/WebCore/DerivedSources-output.xcfilelist 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1279,6 +1279,8 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPositionErrorCallback.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPositionOptions.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPositionOptions.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPostMessageOptions.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPostMessageOptions.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSProcessingInstruction.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSProcessingInstruction.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSProgressEvent.cpp
Modified: trunk/Source/WebCore/DerivedSources.make (253496 => 253497)
--- trunk/Source/WebCore/DerivedSources.make 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/DerivedSources.make 2019-12-13 21:36:25 UTC (rev 253497)
@@ -911,6 +911,7 @@
$(WebCore)/page/PerformanceResourceTiming.idl \
$(WebCore)/page/PerformanceServerTiming.idl \
$(WebCore)/page/PerformanceTiming.idl \
+ $(WebCore)/page/PostMessageOptions.idl \
$(WebCore)/page/RemoteDOMWindow.idl \
$(WebCore)/page/ResizeObserver.idl \
$(WebCore)/page/ResizeObserverCallback.idl \
Modified: trunk/Source/WebCore/Headers.cmake (253496 => 253497)
--- trunk/Source/WebCore/Headers.cmake 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/Headers.cmake 2019-12-13 21:36:25 UTC (rev 253497)
@@ -809,6 +809,7 @@
page/PlugInClient.h
page/PointerCaptureController.h
page/PointerLockController.h
+ page/PostMessageOptions.h
page/PrewarmInformation.h
page/PrintContext.h
page/ProcessWarming.h
Modified: trunk/Source/WebCore/Sources.txt (253496 => 253497)
--- trunk/Source/WebCore/Sources.txt 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/Sources.txt 2019-12-13 21:36:25 UTC (rev 253497)
@@ -3160,6 +3160,7 @@
JSPositionCallback.cpp
JSPositionErrorCallback.cpp
JSPositionOptions.cpp
+JSPostMessageOptions.cpp
JSProcessingInstruction.cpp
JSProgressEvent.cpp
JSPromiseRejectionEvent.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (253496 => 253497)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-12-13 21:36:25 UTC (rev 253497)
@@ -1225,6 +1225,7 @@
463521AD2081092A00C28922 /* WindowProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 463521AA2081090B00C28922 /* WindowProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
+ 466172EC23A2AC1F003AB309 /* PostMessageOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 466172EB23A2ABFA003AB309 /* PostMessageOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
46658DC91FA24B8700F7DD54 /* SWContextManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4672413B1FA24B140088BD6D /* SWContextManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
466ED8D31EDE0144005E43F6 /* JSDOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */; };
4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671E0641D67A57B00C6B497 /* CanvasPath.h */; };
@@ -7716,6 +7717,8 @@
465EDD9D222F4EC300B46E16 /* DeviceOrientationOrMotionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceOrientationOrMotionEvent.idl; sourceTree = "<group>"; };
465EDD9F222F4EC300B46E16 /* DeviceOrientationOrMotionPermissionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationOrMotionPermissionState.h; sourceTree = "<group>"; };
465EDDA0222F4EC400B46E16 /* DeviceOrientationOrMotionPermissionState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceOrientationOrMotionPermissionState.idl; sourceTree = "<group>"; };
+ 466172E923A2ABFA003AB309 /* PostMessageOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PostMessageOptions.idl; sourceTree = "<group>"; };
+ 466172EB23A2ABFA003AB309 /* PostMessageOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostMessageOptions.h; sourceTree = "<group>"; };
466DC6AB1EDE021D00746224 /* JSDOMRectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectList.cpp; sourceTree = "<group>"; };
466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectList.h; sourceTree = "<group>"; };
4671E0631D67A57B00C6B497 /* CanvasPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPath.cpp; sourceTree = "<group>"; };
@@ -20759,6 +20762,8 @@
5CFC434E192406A900A0D3B5 /* PointerLockController.cpp */,
5CFC434F192406A900A0D3B5 /* PointerLockController.h */,
3772B09516535856000A49CA /* PopupOpeningObserver.h */,
+ 466172EB23A2ABFA003AB309 /* PostMessageOptions.h */,
+ 466172E923A2ABFA003AB309 /* PostMessageOptions.idl */,
E4605FEA2166480800E53046 /* PrewarmInformation.h */,
B776D43C1104527500BEB0EC /* PrintContext.cpp */,
B776D43A1104525D00BEB0EC /* PrintContext.h */,
@@ -31780,6 +31785,7 @@
9746AF3014F4DDE6003E7A70 /* PositionErrorCallback.h in Headers */,
37919C240B7D188600A56998 /* PositionIterator.h in Headers */,
9746AF3214F4DDE6003E7A70 /* PositionOptions.h in Headers */,
+ 466172EC23A2AC1F003AB309 /* PostMessageOptions.h in Headers */,
46DBB6501AB8C96F00D9A813 /* PowerObserverMac.h in Headers */,
C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */,
A1C1507A1E3F2B3E0032C98C /* PreviewConverter.h in Headers */,
Modified: trunk/Source/WebCore/dom/MessagePort.cpp (253496 => 253497)
--- trunk/Source/WebCore/dom/MessagePort.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/dom/MessagePort.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -128,7 +128,7 @@
MessagePortChannelProvider::fromContext(*m_scriptExecutionContext).entangleLocalPortInThisProcessToRemote(m_identifier, m_remoteIdentifier);
}
-ExceptionOr<void> MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, PostMessageOptions&& options)
{
LOG(MessagePorts, "Attempting to post message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data());
@@ -135,7 +135,7 @@
registerLocalActivity();
Vector<RefPtr<MessagePort>> ports;
- auto messageData = SerializedScriptValue::create(state, messageValue, WTFMove(transfer), ports);
+ auto messageData = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports);
if (messageData.hasException())
return messageData.releaseException();
Modified: trunk/Source/WebCore/dom/MessagePort.h (253496 => 253497)
--- trunk/Source/WebCore/dom/MessagePort.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/dom/MessagePort.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -32,6 +32,7 @@
#include "MessagePortChannel.h"
#include "MessagePortIdentifier.h"
#include "MessageWithMessagePorts.h"
+#include "PostMessageOptions.h"
#include <wtf/WeakPtr.h>
namespace JSC {
@@ -51,7 +52,7 @@
static Ref<MessagePort> create(ScriptExecutionContext&, const MessagePortIdentifier& local, const MessagePortIdentifier& remote);
virtual ~MessagePort();
- ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
+ ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, PostMessageOptions&&);
void start();
void close();
Modified: trunk/Source/WebCore/dom/MessagePort.idl (253496 => 253497)
--- trunk/Source/WebCore/dom/MessagePort.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/dom/MessagePort.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -31,7 +31,8 @@
GenerateIsReachable=Impl,
JSCustomMarkFunction,
] interface MessagePort : EventTarget {
- [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, sequence<object> transfer);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional PostMessageOptions options);
void start();
void close();
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (253496 => 253497)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -872,7 +872,7 @@
return m_localStorage.get();
}
-ExceptionOr<void> DOMWindow::postMessage(JSC::JSGlobalObject& lexicalGlobalObject, DOMWindow& incumbentWindow, JSC::JSValue messageValue, const String& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> DOMWindow::postMessage(JSC::JSGlobalObject& lexicalGlobalObject, DOMWindow& incumbentWindow, JSC::JSValue messageValue, WindowPostMessageOptions&& options)
{
if (!isCurrentlyDisplayedInFrame())
return { };
@@ -882,12 +882,12 @@
// Compute the target origin. We need to do this synchronously in order
// to generate the SyntaxError exception correctly.
RefPtr<SecurityOrigin> target;
- if (targetOrigin == "/") {
+ if (options.targetOrigin == "/") {
if (!sourceDocument)
return { };
target = &sourceDocument->securityOrigin();
- } else if (targetOrigin != "*") {
- target = SecurityOrigin::createFromString(targetOrigin);
+ } else if (options.targetOrigin != "*") {
+ target = SecurityOrigin::createFromString(options.targetOrigin);
// It doesn't make sense target a postMessage at a unique origin
// because there's no way to represent a unique origin in a string.
if (target->isUnique())
@@ -895,7 +895,7 @@
}
Vector<RefPtr<MessagePort>> ports;
- auto messageData = SerializedScriptValue::create(lexicalGlobalObject, messageValue, WTFMove(transfer), ports, SerializationContext::WindowPostMessage);
+ auto messageData = SerializedScriptValue::create(lexicalGlobalObject, messageValue, WTFMove(options.transfer), ports, SerializationContext::WindowPostMessage);
if (messageData.hasException())
return messageData.releaseException();
Modified: trunk/Source/WebCore/page/DOMWindow.h (253496 => 253497)
--- trunk/Source/WebCore/page/DOMWindow.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/page/DOMWindow.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -33,6 +33,7 @@
#include "Frame.h"
#include "FrameDestructionObserver.h"
#include "ImageBitmap.h"
+#include "PostMessageOptions.h"
#include "ScrollToOptions.h"
#include "ScrollTypes.h"
#include "Supplementable.h"
@@ -96,6 +97,16 @@
enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
enum class IncludeTargetOrigin { No, Yes };
+struct WindowPostMessageOptions : public PostMessageOptions {
+ WindowPostMessageOptions() = default;
+ WindowPostMessageOptions(String&& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ : PostMessageOptions(WTFMove(transfer))
+ , targetOrigin(WTFMove(targetOrigin))
+ { }
+
+ String targetOrigin { "/"_s };
+};
+
// FIXME: Rename DOMWindow to LocalWindow and AbstractDOMWindow to DOMWindow.
class DOMWindow final
: public AbstractDOMWindow
@@ -250,7 +261,12 @@
String crossDomainAccessErrorMessage(const DOMWindow& activeWindow, IncludeTargetOrigin);
- ExceptionOr<void> postMessage(JSC::JSGlobalObject&, DOMWindow& incumbentWindow, JSC::JSValue message, const String& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&&);
+ ExceptionOr<void> postMessage(JSC::JSGlobalObject&, DOMWindow& incumbentWindow, JSC::JSValue message, WindowPostMessageOptions&&);
+ ExceptionOr<void> postMessage(JSC::JSGlobalObject& globalObject, DOMWindow& incumbentWindow, JSC::JSValue message, String&& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ {
+ return postMessage(globalObject, incumbentWindow, message, WindowPostMessageOptions { WTFMove(targetOrigin), WTFMove(transfer) });
+ }
+
void postMessageTimerFired(PostMessageTimer&);
void languagesChanged();
Modified: trunk/Source/WebCore/page/DOMWindow.idl (253496 => 253497)
--- trunk/Source/WebCore/page/DOMWindow.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/page/DOMWindow.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -98,6 +98,7 @@
[EnabledBySetting=requestIdleCallback] void cancelIdleCallback(unsigned long handle);
[CallWith=GlobalObject&IncumbentWindow, DoNotCheckSecurity, ForwardDeclareInHeader, MayThrowException] void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
+ [CallWith=GlobalObject&IncumbentWindow, DoNotCheckSecurity, ForwardDeclareInHeader, MayThrowException] void postMessage(any message, optional WindowPostMessageOptions options);
// Obsolete members, still part of the HTML specification (https://html.spec.whatwg.org/#Window-partial).
void captureEvents(); // Not implemented. Also not in modern standards. Empty function may help compatibility with legacy content.
@@ -205,6 +206,12 @@
[NotEnumerable, ImplementedAs=onwebkitTransitionEnd] attribute EventHandler onwebkittransitionend;
};
+[
+ ImplementedAs=WindowPostMessageOptions
+] dictionary WindowPostMessageOptions : PostMessageOptions {
+ USVString targetOrigin = "/";
+};
+
DOMWindow implements GlobalCrypto;
DOMWindow implements GlobalEventHandlers;
DOMWindow implements GlobalPerformance;
Copied: trunk/Source/WebCore/page/PostMessageOptions.h (from rev 253496, trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl) (0 => 253497)
--- trunk/Source/WebCore/page/PostMessageOptions.h (rev 0)
+++ trunk/Source/WebCore/page/PostMessageOptions.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <_javascript_Core/JSObject.h>
+#include <_javascript_Core/Strong.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+struct PostMessageOptions {
+ PostMessageOptions() = default;
+ PostMessageOptions(Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ : transfer(WTFMove(transfer))
+ { }
+
+ Vector<JSC::Strong<JSC::JSObject>> transfer;
+};
+
+}
Copied: trunk/Source/WebCore/page/PostMessageOptions.idl (from rev 253496, trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl) (0 => 253497)
--- trunk/Source/WebCore/page/PostMessageOptions.idl (rev 0)
+++ trunk/Source/WebCore/page/PostMessageOptions.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary PostMessageOptions {
+ sequence<object> transfer = [];
+};
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (253496 => 253497)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -65,10 +65,10 @@
return DedicatedWorkerGlobalScopeEventTargetInterfaceType;
}
-ExceptionOr<void> DedicatedWorkerGlobalScope::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> DedicatedWorkerGlobalScope::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, PostMessageOptions&& options)
{
Vector<RefPtr<MessagePort>> ports;
- auto message = SerializedScriptValue::create(state, messageValue, WTFMove(transfer), ports, SerializationContext::WorkerPostMessage);
+ auto message = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports, SerializationContext::WorkerPostMessage);
if (message.hasException())
return message.releaseException();
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h (253496 => 253497)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -31,6 +31,7 @@
#pragma once
+#include "PostMessageOptions.h"
#include "WorkerGlobalScope.h"
namespace JSC {
@@ -54,7 +55,7 @@
const String& name() const { return m_name; }
- ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
+ ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, PostMessageOptions&&);
DedicatedWorkerThread& thread();
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl (253496 => 253497)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -39,7 +39,8 @@
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
[Replaceable] readonly attribute DOMString name;
- [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, sequence<object> transfer);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional PostMessageOptions options);
void close();
Modified: trunk/Source/WebCore/workers/Worker.cpp (253496 => 253497)
--- trunk/Source/WebCore/workers/Worker.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/Worker.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -127,10 +127,10 @@
m_contextProxy.workerObjectDestroyed();
}
-ExceptionOr<void> Worker::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> Worker::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, PostMessageOptions&& options)
{
Vector<RefPtr<MessagePort>> ports;
- auto message = SerializedScriptValue::create(state, messageValue, WTFMove(transfer), ports, SerializationContext::WorkerPostMessage);
+ auto message = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports, SerializationContext::WorkerPostMessage);
if (message.hasException())
return message.releaseException();
Modified: trunk/Source/WebCore/workers/Worker.h (253496 => 253497)
--- trunk/Source/WebCore/workers/Worker.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/Worker.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -30,6 +30,7 @@
#include "ContentSecurityPolicyResponseHeaders.h"
#include "EventTarget.h"
#include "MessagePort.h"
+#include "PostMessageOptions.h"
#include "WorkerScriptLoaderClient.h"
#include <_javascript_Core/RuntimeFlags.h>
#include <wtf/MonotonicTime.h>
@@ -57,7 +58,7 @@
static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url, const Options&);
virtual ~Worker();
- ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
+ ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, PostMessageOptions&&);
void terminate();
Modified: trunk/Source/WebCore/workers/Worker.idl (253496 => 253497)
--- trunk/Source/WebCore/workers/Worker.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/Worker.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -32,7 +32,8 @@
] interface Worker : EventTarget {
void terminate();
- [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, sequence<object> transfer);
+ [CallWith=GlobalObject, MayThrowException] void postMessage(any message, optional PostMessageOptions options);
attribute EventHandler onmessage;
};
Modified: trunk/Source/WebCore/workers/service/ServiceWorker.cpp (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorker.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorker.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -104,7 +104,7 @@
return ServiceWorkerProvider::singleton().serviceWorkerConnection();
}
-ExceptionOr<void> ServiceWorker::postMessage(ScriptExecutionContext& context, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> ServiceWorker::postMessage(ScriptExecutionContext& context, JSC::JSValue messageValue, PostMessageOptions&& options)
{
if (m_isStopped)
return Exception { InvalidStateError };
@@ -113,7 +113,7 @@
ASSERT(execState);
Vector<RefPtr<MessagePort>> ports;
- auto messageData = SerializedScriptValue::create(*execState, messageValue, WTFMove(transfer), ports, SerializationContext::WorkerPostMessage);
+ auto messageData = SerializedScriptValue::create(*execState, messageValue, WTFMove(options.transfer), ports, SerializationContext::WorkerPostMessage);
if (messageData.hasException())
return messageData.releaseException();
Modified: trunk/Source/WebCore/workers/service/ServiceWorker.h (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorker.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorker.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -30,6 +30,7 @@
#include "ActiveDOMObject.h"
#include "ContextDestructionObserver.h"
#include "EventTarget.h"
+#include "PostMessageOptions.h"
#include "ServiceWorkerData.h"
#include <_javascript_Core/Strong.h>
#include <wtf/RefCounted.h>
@@ -58,7 +59,7 @@
void updateState(State);
- ExceptionOr<void> postMessage(ScriptExecutionContext&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
+ ExceptionOr<void> postMessage(ScriptExecutionContext&, JSC::JSValue message, PostMessageOptions&&);
ServiceWorkerIdentifier identifier() const { return m_data.identifier; }
ServiceWorkerRegistrationIdentifier registrationIdentifier() const { return m_data.registrationIdentifier; }
Modified: trunk/Source/WebCore/workers/service/ServiceWorker.idl (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorker.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorker.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -36,7 +36,8 @@
] interface ServiceWorker : EventTarget {
readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state;
- [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+ [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, sequence<object> transfer);
+ [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, optional PostMessageOptions options);
// event
attribute EventHandler onstatechange;
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp 2019-12-13 21:36:25 UTC (rev 253497)
@@ -82,13 +82,13 @@
return identifier().toString();
}
-ExceptionOr<void> ServiceWorkerClient::postMessage(ScriptExecutionContext& context, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+ExceptionOr<void> ServiceWorkerClient::postMessage(ScriptExecutionContext& context, JSC::JSValue messageValue, PostMessageOptions&& options)
{
auto* execState = context.execState();
ASSERT(execState);
Vector<RefPtr<MessagePort>> ports;
- auto messageData = SerializedScriptValue::create(*execState, messageValue, WTFMove(transfer), ports, SerializationContext::WorkerPostMessage);
+ auto messageData = SerializedScriptValue::create(*execState, messageValue, WTFMove(options.transfer), ports, SerializationContext::WorkerPostMessage);
if (messageData.hasException())
return messageData.releaseException();
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.h (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.h 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.h 2019-12-13 21:36:25 UTC (rev 253497)
@@ -29,6 +29,7 @@
#include "ContextDestructionObserver.h"
#include "ExceptionOr.h"
+#include "PostMessageOptions.h"
#include "ServiceWorkerClientData.h"
#include <_javascript_Core/Strong.h>
#include <wtf/RefCounted.h>
@@ -59,7 +60,7 @@
Identifier identifier() const { return m_data.identifier; }
- ExceptionOr<void> postMessage(ScriptExecutionContext&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&& transfer);
+ ExceptionOr<void> postMessage(ScriptExecutionContext&, JSC::JSValue message, PostMessageOptions&&);
protected:
ServiceWorkerClient(ServiceWorkerGlobalScope&, ServiceWorkerClientData&&);
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl (253496 => 253497)
--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl 2019-12-13 21:31:18 UTC (rev 253496)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl 2019-12-13 21:36:25 UTC (rev 253497)
@@ -35,7 +35,8 @@
readonly attribute ServiceWorkerClientType type;
readonly attribute DOMString id;
- [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+ [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, sequence<object> transfer);
+ [CallWith=ScriptExecutionContext, MayThrowException] void postMessage(any message, optional PostMessageOptions options);
};
enum FrameType {