diff --git a/source b/source index b8b39d4b899..3947d130844 100644 --- a/source +++ b/source @@ -94350,16 +94350,29 @@ function receiver(e) {
When a script invokes the postMessage(message, targetOrigin,
- transfer)
method on a Window
object, the user agent must
- follow these steps:
The postMessage(message,
+ targetOrigin, transfer)
method, when invoked on a
+ Window
object must run the following steps:
Let targetWindow be this Window
object.
Let targetRealm be targetWindow's Realm.
Let incumbentSettings be the incumbent settings object.
If targetOrigin is a single U+002F SOLIDUS character (/), then set + targetOrigin to incumbentSettings's origin.
+If the value of the targetOrigin argument is neither a single U+002A ASTERISK - character (*) nor a single U+002F SOLIDUS character (/), then:
+Otherwise, if targetOrigin is not a single U+002A ASTERISK character (*), + then:
Let parsedURL be the result of running the URL parser on @@ -94373,59 +94386,39 @@ function receiver(e) {
Let targetRealm be this Window
object's Realm.
Let incumbentSettings be the incumbent settings object.
Let cloneRecord be StructuredCloneWithTransfer(message, transfer, targetRealm). Rethrow any exceptions.
Let message clone be cloneRecord.[[Clone]].
Let messageClone be cloneRecord.[[Clone]].
Let new ports be a new frozen array consisting of all +
Let newPorts be a new frozen array consisting of all
MessagePort
objects in cloneRecord.[[TransferList]], if any, maintaining
their relative order.
Return, but continue running these steps in in parallel.
If the targetOrigin argument is a single literal U+002F SOLIDUS character (/), and
- this Window
object's associated
- Document
's origin is not same origin with
- incumbentSettings's responsible document's origin, then
- abort these steps.
Otherwise, if the targetOrigin argument is not a single literal U+002A ASTERISK
- character (*) and this Window
object's associated Document
's origin
- is not same origin with targetOrigin, then abort these steps.
Create a trusted event that uses the
- If the targetOrigin argument is not a single literal U+002A ASTERISK character
+ (*) and targetWindow's associated
+ MessageEvent
interface, with the event type message
, which does not bubble, is not cancelable, and has no
- default action. The data
attribute must be
- initialised to the value of message clone, the origin
attribute must be initialised to the Unicode serialisation of the
- origin specified by incumbentSettings, the Document
's origin is not same origin with
+ targetOrigin, then abort these steps.
Create a trusted event e that uses
+ the MessageEvent
interface, with the event type message
, which does not bubble and is not cancelable. The data
attribute must be initialised to
+ messageClone, the origin
attribute must
+ be initialised to the Unicode
+ serialisation of incumbentSettings's origin, the source
attribute must be initialised to the
- WindowProxy
object corresponding to the global object (a Window
object)
- specified by incumbentSettings, and the ports
attribute must be initialised to the new
- ports array.
WindowProxy
object corresponding incumbentSettings's global object (a Window
object), and
+ the ports
attribute must be initialised to
+ newPorts.
- Queue a task to dispatch the
- event created in the previous step at the Window
object on which the method was
- invoked. The task source for this task is the
- posted message task source.
Queue a task to dispatch + e at targetWindow. The task source for this task is the posted message task source.
The postMessage()
method, when
- called on a port source port, must cause the user agent to run the following
- steps:
The postMessage(message,
+ transfer)
method, when invoked on a MessagePort
object, must
+ run the following steps:
Let target port be the port with which source port - is entangled, if any.
Let targetPort be the port with which this MessagePort
is
+ entangled, if any; otherwise let it be null.
Let doomed be false.
@@ -94906,22 +94898,23 @@ interface MessagePort : EventTarget { called.)If any of the objects in transfer are the source port, then throw a
- "DataCloneError
" DOMException
and abort these
+
If any of the objects in transfer are this MessagePort
, then throw
+ a "DataCloneError
" DOMException
and abort these
steps.
If any of the objects in transfer are the target port, if any, then - let doomed be true, and optionally report to a developer console that the target port - was posted to itself, causing the communication channel to be lost.
If targetPort is not null and any of the objects in transfer are + targetPort, then set doomed to true, and optionally report to a developer + console that the target port was posted to itself, causing the communication channel to be + lost.
Let targetRealm be target port's Let targetRealm be targetPort's owner's Realm, if there is a target port and doomed is false, and - otherwise some arbitrary Realm.
+ realm">Realm, if targetPort is non-null and doomed is false; + otherwise let targetRealm be some arbitrary Realm.targetRealm is used when cloning and transferring objects below. If - there is no target port, or if the target port is one of the objects being + there is no target port, or if the targetPort is one of the objects being transferred, the transferable objects given in the second argument, if any, are still transferred, but since they are then discarded, it doesn't matter where they are transferred to.)
@@ -94930,14 +94923,14 @@ interface MessagePort : EventTarget {Let cloneRecord be StructuredCloneWithTransfer(message, transfer, targetRealm). Rethrow any exceptions.
Let message clone be cloneRecord.[[Clone]].
Let messageClone be cloneRecord.[[Clone]].
Let new ports be a new frozen array consisting of all +
Let newPorts be a new frozen array consisting of all
MessagePort
objects in cloneRecord.[[TransferList]], if any, maintaining
their relative order.
If there is no target port (i.e. if source port - is not entangled), or if doomed is true, then abort these steps.
If there is no targetPort (i.e. if this MessagePort
is not
+ entangled), or if doomed is true, then abort these steps.
Create an event e that uses the MessageEvent
interface, with the name message
, which does not bubble, is not cancelable, and has no
- default action.
Let the data
attribute of e be
- initialised to the value of message clone.
Let the ports
attribute of e be
- initialised to the new ports array.
Create an event e that uses the MessageEvent
interface, with the
+ name message
, which does not bubble and is not
+ cancelable. The data
attribute must be initialised to
+ messageClone and the ports
attribute must
+ be initialised to newPorts.
Add a task that runs the following steps to the port - message queue of target port:
+ message queue of targetPort:Let target be the MessagePort
in whose port message
queue the event e now finds itself.
Dispatch e at target.
The name
attribute must return the
channel name.
The postMessage()
method,
- when invoked on a BroadcastChannel
object source with an
- argument message, must run the following steps:
The postMessage(message)
method,
+ when invoked on a BroadcastChannel
object, must run the following steps:
Let source be this BroadcastChannel
.
Let source settings be source's
- BroadcastChannel
settings object.
Let sourceSettings be source's BroadcastChannel
+ settings object.
If source's closed flag
is true, then throw an "InvalidStateError
" DOMException
and abort these steps.
Let source channel be source's - channel name.
+Let sourceChannel be source's channel name.
Let targetRealm be a user-agent defined Realm.
Let cloned message be StructuredClone(message, +
Let clonedMessage be StructuredClone(message, targetRealm). Rethrow any exceptions.
Let destinations be a list of BroadcastChannel
objects that
match the following criteria:
Their BroadcastChannel
settings object specifies either:
a global object that is a
Window
object and a responsible document that is fully
active, or
a global object that is a
- WorkerGlobalScope
object whose closing
flag is false and whose
+ WorkerGlobalScope
object whose closing flag is false and whose
worker is a suspendable worker.
Their BroadcastChannel
settings object specifies an
- origin that is the same origin as the origin specified
- by source settings.
Their BroadcastChannel
settings object's origin
+ is same origin with sourceSettings's origin.
Their channel name is a case-sensitive match for source channel.
Their channel name is a case-sensitive match for + sourceChannel.
Their closed flag is false.
Remove source from destinations.
Sort destinations such that all BroadcastChannel
objects
- whose BroadcastChannel
settings
- objects specify the same responsible event loop are sorted in creation
- order, oldest first. (This does not define a complete ordering. Within this constraint, user
- agents may sort the list in any user-agent defined manner.)
Sort destinations such that all BroadcastChannel
objects whose
+ BroadcastChannel
settings
+ objects specify the same responsible event loop are sorted in creation
+ order, oldest first. (This does not define a complete ordering. Within this constraint, user
+ agents may sort the list in any user-agent defined manner.)
For each BroadcastChannel
object in destinations,
- queue a task that runs the following steps:
For each BroadcastChannel
object destination in
+ destinations, queue a task that runs the following steps:
Let targetRealm be BroadcastChannel
object's relevant
- settings object's Realm.
Create an event that uses the MessageEvent
interface, with the event type
- message
, which does not bubble, is not cancelable, and has
- no default action. The data
attribute must be
- initialised to StructuredClone(cloned message,
- targetRealm), and the origin
- attribute must be initialised to the Unicode
- serialisation of the origin specified by source settings. This
- event is not trusted.
Dispatch the event at the
- BroadcastChannel
object.
Let targetRealm be destination's relevant settings + object's Realm.
Create an event e that uses the MessageEvent
interface, with the
+ event type message
, which does not bubble and is not
+ cancelable. The data
attribute must be initialised
+ to StructuredClone(clonedMessage, targetRealm)
+ and the origin
attribute must be initialised to
+ the Unicode serialisation of
+ sourceSettings's origin.
Dispatch e at + destination.
The tasks must use the DOM
- manipulation task source, and, for those where the event loop specified by the target BroadcastChannel
object's
- BroadcastChannel
settings object is a browsing context event loop, must
- be associated with the responsible
- document specified by that target BroadcastChannel
object's
- BroadcastChannel
settings object.
The tasks must use the DOM manipulation task
+ source, and, for those where the event loop specified by the target
+ BroadcastChannel
object's BroadcastChannel
settings
+ object is a browsing context event loop, must be associated
+ with the responsible document specified by that target
+ BroadcastChannel
object's BroadcastChannel
settings
+ object.
While a BroadcastChannel
object whose