diff --git a/source b/source
index 3e907bc3626..b4b2752adb5 100644
--- a/source
+++ b/source
@@ -78126,9 +78126,13 @@ interface Window : Eve
void print();
void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
+ void postMessage(any message, optional WindowPostMessageOptions options);
};
Window includes GlobalEventHandlers;
-Window includes WindowEventHandlers;
+
+dictionary WindowPostMessageOptions : PostMessageOptions {
+ USVString targetOrigin = "/";
+};
- Let targetWindow be this Let targetRealm be targetWindow's Realm. Let targetOrigin be options[" If targetOrigin is a single U+002F SOLIDUS character (/), then set
targetOrigin to incumbentSettings's origin. Let transfer be options[" Let serializeWithTransferResult be
StructuredSerializeWithTransfer(message, transfer). Rethrow
any exceptions.Window
object.targetOrigin
"].transfer
"].
Let source be the WindowProxy
object's corresponding to
+
Let source be the WindowProxy
object corresponding to
incumbentSettings's global
object (a Window
object).
The postMessage(message,
+ options)
method, when invoked on a
+ Window
object, must run the following steps:
Let targetWindow be this Window
object.
Run the window post message steps providing targetWindow, + message, and options.
The postMessage(message,
+ targetOrigin, transfer)
method, when invoked on a
+ Window
object, must run the following steps:
Let targetWindow be this Window
object.
Let options be «[ "targetOrigin
" →
+ targetOrigin, "transfer
" → transfer ]».
Run the window post message steps providing targetWindow, + message, and options.
[Exposed=(Window,Worker,AudioWorklet), Transferable]
interface MessagePort : EventTarget {
void postMessage(any message, optional sequence<object> transfer = []);
+ void postMessage(any message, PostMessageOptions options);
void start();
void close();
// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
+};
+
+dictionary PostMessageOptions {
+ sequence<object> transfer = [];
};
postMessage
(message [, transfer] )postMessage
(message [, { transfer
}] )Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
@@ -96541,13 +96584,11 @@ interface MessagePort : EventTarget {The postMessage(message,
- transfer)
method, when invoked on a MessagePort
object, must
- run the following steps:
The message port post message steps, given a targetPort, message + and options are as follows:
-Let targetPort be the port with which this MessagePort
is
- entangled, if any; otherwise let it be null.
Let transfer be options["transfer
"].
If transfer contains this
MessagePort
, then throw a "DataCloneError
"
@@ -96614,6 +96655,33 @@ interface MessagePort : EventTarget {
The postMessage(message,
+ options)
method, when invoked on a MessagePort
object must
+ run the following steps:
Let targetPort be the port with which this MessagePort
is
+ entangled, if any; otherwise let it be null.
Run the message port post message steps providing targetPort, + message and options.
The postMessage(message,
+ transfer)
method, when invoked on a MessagePort
object
+ must run the following steps:
Let targetPort be the port with which this MessagePort
is
+ entangled, if any; otherwise let it be null.
Let options be «[ "transfer
" → transfer
+ ]».
Run the message port post message steps providing targetPort, + message and options.
The start()
method, when invoked, must
@@ -97508,6 +97576,7 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope
[Replaceable] readonly attribute DOMString name;
void postMessage(any message, optional sequence<object> transfer = []);
+ void postMessage(any message, PostMessageOptions options);
void close();
@@ -97532,6 +97601,9 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope
postMessage
(message [,
transfer ])postMessage
(message
+ [, { transfer
} ])Worker
object associated with
dedicatedWorkerGlobal. transfer can be passed as a list of objects that are
to be transferred rather than cloned.Worker
constructor, used primarily for debugging purposes.
- The postMessage()
- method on DedicatedWorkerGlobalScope
objects must act as if, when invoked, it
- immediately invoked the method of the same name
- on the port, with the same arguments, and returned the same return value.
The postMessage(message,
+ transfer)
and postMessage(message,
+ options)
methods on DedicatedWorkerGlobalScope
objects
+ act as if, when invoked, it immediately invoked the respective postMessage(message, transfer)
+ and postMessage(message,
+ options)
on the port, with the same arguments, and returned the same return
+ value.
To close a worker, given a workerGlobal, run these steps:
@@ -98243,6 +98321,7 @@ interface Worker : EventTarget { void terminate(); void postMessage(any message, optional sequence<object> transfer = []); + void postMessage(any message, PostMessageOptions options); attribute EventHandler onmessage; attribute EventHandler onmessageerror; }; @@ -98271,7 +98350,11 @@ enum WorkerType { "classic", "module" };terminate
()postMessage
(message [, transfer ])
+ postMessage
(message [, transfer ] )
+ postMessage
(message [, { transfer
} ] )
All messages received by that port must immediately be retargeted at the Worker
object.
The postMessage()
method on
- Worker
objects must act as if, when invoked, it immediately invoked the method of the same name on the port, with the same
- arguments, and returned the same return value.
The postMessage(message,
+ transfer)
and postMessage(message,
+ options)
methods on Worker
objects act as if, when invoked,
+ they immediately invoked the respective postMessage(message, transfer)
+ and postMessage(message,
+ options)
on the port, with the same arguments, and returned the same return
+ value.