diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 760d62e0b..8ff5e3324 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -151,7 +151,6 @@ interface ByteLengthChunk { } interface CacheQueryOptions { - cacheName?: string; ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; @@ -760,6 +759,10 @@ interface MouseEventInit extends EventModifierInit { screenY?: number; } +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + interface MutationObserverInit { attributeFilter?: string[]; attributeOldValue?: boolean; @@ -909,7 +912,8 @@ interface Pbkdf2Params extends Algorithm { interface PerformanceObserverInit { buffered?: boolean; - entryTypes: string[]; + entryTypes?: string[]; + type?: string; } interface PeriodicWaveConstraints { @@ -955,6 +959,10 @@ interface PositionOptions { timeout?: number; } +interface PostMessageOptions { + transfer?: any[]; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -1965,6 +1973,7 @@ interface AudioContext extends BaseAudioContext { createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack): MediaStreamTrackAudioSourceNode; getOutputTimestamp(): AudioTimestamp; + resume(): Promise; suspend(): Promise; addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -2202,7 +2211,6 @@ interface BaseAudioContext extends EventTarget { createStereoPanner(): StereoPannerNode; createWaveShaper(): WaveShaperNode; decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; - resume(): Promise; addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7161,6 +7169,8 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { * Sets or retrieves the language code of the object. */ hreflang: string; + imageSizes: string; + imageSrcset: string; integrity: string; /** * Sets or retrieves the media type. @@ -10282,14 +10292,8 @@ interface MessagePort extends EventTarget { * Disconnects the port, so that it is no longer active. */ close(): void; - /** - * 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. - * Throws a "DataCloneError" DOMException if - * transfer contains duplicate objects or port, or if message - * could not be cloned. - */ - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; /** * Begins dispatching messages received on the port. */ @@ -10931,6 +10935,7 @@ interface OfflineAudioContextEventMap extends BaseAudioContextEventMap { interface OfflineAudioContext extends BaseAudioContext { readonly length: number; oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null; + resume(): Promise; startRendering(): Promise; suspend(suspendTime: number): Promise; addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -11284,13 +11289,14 @@ declare var PerformanceNavigationTiming: { interface PerformanceObserver { disconnect(): void; - observe(options: PerformanceObserverInit): void; + observe(options?: PerformanceObserverInit): void; takeRecords(): PerformanceEntryList; } declare var PerformanceObserver: { prototype: PerformanceObserver; new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: ReadonlyArray; }; interface PerformanceObserverEntryList { @@ -14583,7 +14589,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 730d5697a..6f55f72e5 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -44,7 +44,6 @@ interface BlobPropertyBag { } interface CacheQueryOptions { - cacheName?: string; ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; @@ -177,9 +176,9 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { interface FetchEventInit extends ExtendableEventInit { clientId?: string; preloadResponse?: Promise; + replacesClientId?: string; request: Request; resultingClientId?: string; - targetClientId?: string; } interface FilePropertyBag extends BlobPropertyBag { @@ -253,6 +252,10 @@ interface MidiPermissionDescriptor extends PermissionDescriptor { sysex?: boolean; } +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; @@ -294,7 +297,8 @@ interface Pbkdf2Params extends Algorithm { interface PerformanceObserverInit { buffered?: boolean; - entryTypes: string[]; + entryTypes?: string[]; + type?: string; } interface PermissionDescriptor { @@ -308,6 +312,10 @@ interface PipeOptions { signal?: AbortSignal; } +interface PostMessageOptions { + transfer?: any[]; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -692,6 +700,7 @@ declare var CanvasPattern: { /** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */ interface Client { + readonly frameType: FrameType; readonly id: string; readonly type: ClientTypes; readonly url: string; @@ -1087,7 +1096,8 @@ interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; close(): void; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -1331,9 +1341,9 @@ declare var ExtendableMessageEvent: { interface FetchEvent extends ExtendableEvent { readonly clientId: string; readonly preloadResponse: Promise; + readonly replacesClientId: string; readonly request: Request; readonly resultingClientId: string; - readonly targetClientId: string; respondWith(r: Response | Promise): void; } @@ -2081,14 +2091,8 @@ interface MessagePort extends EventTarget { * Disconnects the port, so that it is no longer active. */ close(): void; - /** - * 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. - * Throws a "DataCloneError" DOMException if - * transfer contains duplicate objects or port, or if message - * could not be cloned. - */ - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; /** * Begins dispatching messages received on the port. */ @@ -2305,13 +2309,14 @@ declare var PerformanceMeasure: { interface PerformanceObserver { disconnect(): void; - observe(options: PerformanceObserverInit): void; + observe(options?: PerformanceObserverInit): void; takeRecords(): PerformanceEntryList; } declare var PerformanceObserver: { prototype: PerformanceObserver; new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: ReadonlyArray; }; interface PerformanceObserverEntryList { @@ -2655,7 +2660,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4462,7 +4468,8 @@ interface WritableStreamErrorCallback { declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; declare function close(): void; -declare function postMessage(message: any, transfer?: Transferable[]): void; +declare function postMessage(message: any, transfer: Transferable[]): void; +declare function postMessage(message: any, options?: PostMessageOptions): void; /** * Dispatches a synthetic event event to target and returns true * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. @@ -4544,6 +4551,7 @@ type Transferable = ArrayBuffer | MessagePort | ImageBitmap; type BinaryType = "blob" | "arraybuffer"; type ClientTypes = "window" | "worker" | "sharedworker" | "all"; type EndingType = "transparent" | "native"; +type FrameType = "auxiliary" | "top-level" | "nested" | "none"; type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "pending" | "done"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; diff --git a/inputfiles/idl/Gamepad Extensions.widl b/inputfiles/idl/Gamepad Extensions.widl index bf64b0112..0491567ab 100644 --- a/inputfiles/idl/Gamepad Extensions.widl +++ b/inputfiles/idl/Gamepad Extensions.widl @@ -14,16 +14,16 @@ enum GamepadHapticActuatorType { }; interface GamepadPose { - readonly attribute boolean hasOrientation; - readonly attribute boolean hasPosition; + readonly attribute boolean hasOrientation; + readonly attribute boolean hasPosition; - readonly attribute Float32Array? position; - readonly attribute Float32Array? linearVelocity; - readonly attribute Float32Array? linearAcceleration; - readonly attribute Float32Array? orientation; - readonly attribute Float32Array? angularVelocity; - readonly attribute Float32Array? angularAcceleration; - }; + readonly attribute Float32Array? position; + readonly attribute Float32Array? linearVelocity; + readonly attribute Float32Array? linearAcceleration; + readonly attribute Float32Array? orientation; + readonly attribute Float32Array? angularVelocity; + readonly attribute Float32Array? angularAcceleration; +}; partial interface Gamepad { readonly attribute GamepadHand hand; diff --git a/inputfiles/idl/Geolocation.widl b/inputfiles/idl/Geolocation.widl index 75641802c..b53424124 100644 --- a/inputfiles/idl/Geolocation.widl +++ b/inputfiles/idl/Geolocation.widl @@ -1,29 +1,29 @@ partial interface Navigator { - readonly attribute Geolocation geolocation; - }; + readonly attribute Geolocation geolocation; +}; [NoInterfaceObject] - interface Geolocation { - void getCurrentPosition(PositionCallback successCallback, - optional PositionErrorCallback errorCallback, - optional PositionOptions options); +interface Geolocation { + void getCurrentPosition(PositionCallback successCallback, + optional PositionErrorCallback errorCallback, + optional PositionOptions options); - long watchPosition(PositionCallback successCallback, - optional PositionErrorCallback errorCallback, - optional PositionOptions options); + long watchPosition(PositionCallback successCallback, + optional PositionErrorCallback errorCallback, + optional PositionOptions options); - void clearWatch(long watchId); - }; + void clearWatch(long watchId); +}; - callback PositionCallback = void (Position position); +callback PositionCallback = void (Position position); - callback PositionErrorCallback = void (PositionError positionError); +callback PositionErrorCallback = void (PositionError positionError); dictionary PositionOptions { - boolean enableHighAccuracy = false; - [Clamp] unsigned long timeout = 0xFFFFFFFF; - [Clamp] unsigned long maximumAge = 0; - }; + boolean enableHighAccuracy = false; + [Clamp] unsigned long timeout = 0xFFFFFFFF; + [Clamp] unsigned long maximumAge = 0; +}; [NoInterfaceObject] interface Position { diff --git a/inputfiles/idl/HTML - Semantics.widl b/inputfiles/idl/HTML - Semantics.widl index 93b8d41d5..d6b07f6e5 100644 --- a/inputfiles/idl/HTML - Semantics.widl +++ b/inputfiles/idl/HTML - Semantics.widl @@ -32,6 +32,8 @@ interface HTMLLinkElement : HTMLElement { [CEReactions] attribute DOMString hreflang; [CEReactions] attribute DOMString type; [SameObject, PutForwards=value] readonly attribute DOMTokenList sizes; + [CEReactions] attribute USVString imageSrcset; + [CEReactions] attribute DOMString imageSizes; [CEReactions] attribute DOMString referrerPolicy; }; HTMLLinkElement includes LinkStyle; diff --git a/inputfiles/idl/HTML - Web storage.widl b/inputfiles/idl/HTML - Web storage.widl index 1c15120ed..fd83dd106 100644 --- a/inputfiles/idl/HTML - Web storage.widl +++ b/inputfiles/idl/HTML - Web storage.widl @@ -26,6 +26,8 @@ interface StorageEvent : Event { readonly attribute DOMString? newValue; readonly attribute USVString url; readonly attribute Storage? storageArea; + + void initStorageEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional DOMString? key = null, optional DOMString? oldValue = null, optional DOMString? newValue = null, optional USVString url = "", optional Storage? storageArea = null); }; dictionary StorageEventInit : EventInit { diff --git a/inputfiles/idl/Performance Timeline.widl b/inputfiles/idl/Performance Timeline.widl index 851b9797d..85d44abaa 100644 --- a/inputfiles/idl/Performance Timeline.widl +++ b/inputfiles/idl/Performance Timeline.widl @@ -18,14 +18,16 @@ callback PerformanceObserverCallback = void (PerformanceObserverEntryList entrie PerformanceObserver observer); [Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)] interface PerformanceObserver { - void observe (PerformanceObserverInit options); + void observe (optional PerformanceObserverInit options); void disconnect (); PerformanceEntryList takeRecords(); + static readonly attribute FrozenArray supportedEntryTypes; }; dictionary PerformanceObserverInit { - required sequence entryTypes; - boolean buffered = false; + sequence entryTypes; + DOMString type; + boolean buffered; }; [Exposed=(Window,Worker)] diff --git a/inputfiles/idl/Pointer Events.widl b/inputfiles/idl/Pointer Events.widl index 41cab060e..9f3e2ff89 100644 --- a/inputfiles/idl/Pointer Events.widl +++ b/inputfiles/idl/Pointer Events.widl @@ -31,7 +31,7 @@ partial interface Element { boolean hasPointerCapture (long pointerId); }; -partial interface GlobalEventHandlers { +partial interface mixin GlobalEventHandlers { attribute EventHandler ongotpointercapture; attribute EventHandler onlostpointercapture; attribute EventHandler onpointerdown; diff --git a/inputfiles/idl/Screen Orientation.widl b/inputfiles/idl/Screen Orientation.widl index 253310719..d995e9ac1 100644 --- a/inputfiles/idl/Screen Orientation.widl +++ b/inputfiles/idl/Screen Orientation.widl @@ -11,18 +11,18 @@ interface ScreenOrientation : EventTarget { attribute EventHandler onchange; }; -enum OrientationType { +enum OrientationLockType { + "any", + "natural", + "landscape", + "portrait", "portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary" }; -enum OrientationLockType { - "any", - "natural", - "landscape", - "portrait", +enum OrientationType { "portrait-primary", "portrait-secondary", "landscape-primary", diff --git a/inputfiles/idl/Service Workers.widl b/inputfiles/idl/Service Workers.widl index 03a745f7a..d23efa1c9 100644 --- a/inputfiles/idl/Service Workers.widl +++ b/inputfiles/idl/Service Workers.widl @@ -2,7 +2,8 @@ interface ServiceWorker : EventTarget { readonly attribute USVString scriptURL; readonly attribute ServiceWorkerState state; - void postMessage(any message, optional sequence transfer = []); + void postMessage(any message, sequence transfer); + void postMessage(any message, optional PostMessageOptions options); // event attribute EventHandler onstatechange; @@ -105,9 +106,11 @@ interface ServiceWorkerGlobalScope : WorkerGlobalScope { [Exposed=ServiceWorker] interface Client { readonly attribute USVString url; + readonly attribute FrameType frameType; readonly attribute DOMString id; readonly attribute ClientType type; - void postMessage(any message, optional sequence transfer = []); + void postMessage(any message, sequence transfer); + void postMessage(any message, optional PostMessageOptions options); }; [Exposed=ServiceWorker] @@ -119,6 +122,13 @@ interface WindowClient : Client { [NewObject] Promise navigate(USVString url); }; +enum FrameType { + "auxiliary", + "top-level", + "nested", + "none" +}; + [Exposed=ServiceWorker] interface Clients { // The objects returned will be new instances every time @@ -155,7 +165,7 @@ interface FetchEvent : ExtendableEvent { readonly attribute Promise preloadResponse; readonly attribute DOMString clientId; readonly attribute DOMString resultingClientId; - readonly attribute DOMString targetClientId; + readonly attribute DOMString replacesClientId; void respondWith(Promise r); }; @@ -165,7 +175,7 @@ dictionary FetchEventInit : ExtendableEventInit { Promise preloadResponse; DOMString clientId = ""; DOMString resultingClientId = ""; - DOMString targetClientId = ""; + DOMString replacesClientId = ""; }; [Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), Exposed=ServiceWorker] @@ -185,7 +195,7 @@ dictionary ExtendableMessageEventInit : ExtendableEventInit { sequence ports = []; }; -partial interface WindowOrWorkerGlobalScope { +partial interface mixin WindowOrWorkerGlobalScope { [SecureContext, SameObject] readonly attribute CacheStorage caches; }; @@ -204,14 +214,17 @@ dictionary CacheQueryOptions { boolean ignoreSearch = false; boolean ignoreMethod = false; boolean ignoreVary = false; - DOMString cacheName; }; [SecureContext, Exposed=(Window,Worker)] interface CacheStorage { - [NewObject] Promise match(RequestInfo request, optional CacheQueryOptions options); + [NewObject] Promise match(RequestInfo request, optional MultiCacheQueryOptions options); [NewObject] Promise has(DOMString cacheName); [NewObject] Promise open(DOMString cacheName); [NewObject] Promise delete(DOMString cacheName); [NewObject] Promise> keys(); }; + +dictionary MultiCacheQueryOptions : CacheQueryOptions { + DOMString cacheName; +}; diff --git a/inputfiles/idl/Storage.widl b/inputfiles/idl/Storage.widl index c45690352..07e853220 100644 --- a/inputfiles/idl/Storage.widl +++ b/inputfiles/idl/Storage.widl @@ -1,6 +1,6 @@ [SecureContext] interface mixin NavigatorStorage { - readonly attribute StorageManager storage; + [SameObject] readonly attribute StorageManager storage; }; Navigator includes NavigatorStorage; WorkerNavigator includes NavigatorStorage; diff --git a/inputfiles/idl/Web Audio.widl b/inputfiles/idl/Web Audio.widl index 3cc519abe..03426b150 100644 --- a/inputfiles/idl/Web Audio.widl +++ b/inputfiles/idl/Web Audio.widl @@ -43,7 +43,6 @@ interface BaseAudioContext : EventTarget { Promise decodeAudioData (ArrayBuffer audioData, optional DecodeSuccessCallback? successCallback, optional DecodeErrorCallback? errorCallback); - Promise resume (); }; enum AudioContextLatencyCategory { @@ -58,6 +57,7 @@ interface AudioContext : BaseAudioContext { readonly attribute double baseLatency; readonly attribute double outputLatency; AudioTimestamp getOutputTimestamp (); + Promise resume (); Promise suspend (); Promise close (); MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement); @@ -81,6 +81,7 @@ dictionary AudioTimestamp { Constructor (unsigned long numberOfChannels, unsigned long length, float sampleRate)] interface OfflineAudioContext : BaseAudioContext { Promise startRendering(); + Promise resume(); Promise suspend(double suspendTime); readonly attribute unsigned long length; attribute EventHandler oncomplete; diff --git a/inputfiles/idl/Web Messaging.commentmap.json b/inputfiles/idl/Web Messaging.commentmap.json index 26c8e8ae2..4d30dd15e 100644 --- a/inputfiles/idl/Web Messaging.commentmap.json +++ b/inputfiles/idl/Web Messaging.commentmap.json @@ -1,8 +1,9 @@ { - "window-postmessage": "Posts a message to the given window. Messages can be structured objects, e.g. nested objects\nand arrays, can contain JavaScript values (strings, numbers, Date\nobjects, etc), and can contain certain data objects such as File Blob,\nFileList, and ArrayBuffer objects.\nObjects listed in transfer are transferred, not just cloned, meaning that\nthey are no longer usable on the sending side.\nIf the origin of the target window doesn't match the given origin, the message is discarded,\nto avoid information leakage. To send the message to the target regardless of origin, set the\ntarget origin to \"*\". To restrict the message to same-origin targets only,\nwithout needing to explicitly state the origin, set the target origin to \"/\".\nThrows a \"DataCloneError\" DOMException if\ntransfer array contains duplicate objects or if message could not be\ncloned.", + "window-postmessage-options": "Posts a message to the given window. Messages can be structured objects, e.g. nested objects\nand arrays, can contain JavaScript values (strings, numbers, Date\nobjects, etc), and can contain certain data objects such as File Blob,\nFileList, and ArrayBuffer objects.\nObjects listed in the transfer member of options are\ntransferred, not just cloned, meaning that they are no longer usable on the sending side.\nA target origin can be specified using the targetOrigin member of\noptions. If not provided, it defaults to \"/\". This default\nrestricts the message to same-origin targets only.\nIf the origin of the target window doesn't match the given target origin, the message is\ndiscarded, to avoid information leakage. To send the message to the target regardless of origin,\nset the target origin to \"*\".\nThrows a \"DataCloneError\" DOMException if\ntransfer array contains duplicate objects or if message could not be\ncloned.", + "window-postmessage": "This is an alternate version of postMessage() where the target origin is specified\nas a parameter. Calling window.postMessage(message, target, transfer) is\nequivalent to window.postMessage(message, {targetOrigin, transfer}).", "messagechannel": "Returns a new MessageChannel object with two new MessagePort objects.", "messagechannel-port": "Returns the second MessagePort object.", - "messageport-postmessage": "Posts a message through the channel. Objects listed in transfer are\ntransferred, not just cloned, meaning that they are no longer usable on the sending side.\nThrows a \"DataCloneError\" DOMException if\ntransfer contains duplicate objects or port, or if message\ncould not be cloned.", + "messageport-postmessage-options": "Posts a message through the channel. Objects listed in transfer are\ntransferred, not just cloned, meaning that they are no longer usable on the sending side.\nThrows a \"DataCloneError\" DOMException if\ntransfer contains duplicate objects or port, or if message\ncould not be cloned.", "messageport-start": "Begins dispatching messages received on the port.", "messageport-close": "Disconnects the port, so that it is no longer active.", "broadcastchannel": "Returns a new BroadcastChannel object via which messages for the given channel\nname can be sent and received.", diff --git a/inputfiles/idl/Web Messaging.widl b/inputfiles/idl/Web Messaging.widl index 80190c911..c2a4dd690 100644 --- a/inputfiles/idl/Web Messaging.widl +++ b/inputfiles/idl/Web Messaging.widl @@ -6,7 +6,8 @@ interface MessageChannel { [Exposed=(Window,Worker,AudioWorklet), Transferable] interface MessagePort : EventTarget { - void postMessage(any message, optional sequence transfer = []); + void postMessage(any message, sequence transfer); + void postMessage(any message, optional PostMessageOptions options); void start(); void close(); @@ -15,6 +16,10 @@ interface MessagePort : EventTarget { attribute EventHandler onmessageerror; }; +dictionary PostMessageOptions { + sequence transfer = []; +}; + [Constructor(DOMString name), Exposed=(Window,Worker)] interface BroadcastChannel : EventTarget { readonly attribute DOMString name; diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index 51c551ebd..340453345 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -2394,7 +2394,8 @@ "postMessage": { "name": "postMessage", "override-signatures": [ - "postMessage(message: any, transfer?: Transferable[]): void" + "postMessage(message: any, transfer: Transferable[]): void", + "postMessage(message: any, options?: PostMessageOptions): void" ] } } @@ -2407,7 +2408,8 @@ "postMessage": { "name": "postMessage", "override-signatures": [ - "postMessage(message: any, transfer?: Transferable[]): void" + "postMessage(message: any, transfer: Transferable[]): void", + "postMessage(message: any, options?: PostMessageOptions): void" ] } } @@ -2420,7 +2422,8 @@ "postMessage": { "name": "postMessage", "override-signatures": [ - "postMessage(message: any, transfer?: Transferable[]): void" + "postMessage(message: any, transfer: Transferable[]): void", + "postMessage(message: any, options?: PostMessageOptions): void" ] } }