summaryrefslogtreecommitdiffstats
path: root/vendor/web-sys/webidls/unstable
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/web-sys/webidls/unstable
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/web-sys/webidls/unstable')
-rw-r--r--vendor/web-sys/webidls/unstable/Bluetooth.webidl236
-rw-r--r--vendor/web-sys/webidls/unstable/Clipboard.webidl61
-rw-r--r--vendor/web-sys/webidls/unstable/ImageCapture.webidl22
-rw-r--r--vendor/web-sys/webidls/unstable/MediaCaptureTransform.webidl20
-rw-r--r--vendor/web-sys/webidls/unstable/MediaSession.webidl77
-rw-r--r--vendor/web-sys/webidls/unstable/QueuingStrategy.webidl15
-rw-r--r--vendor/web-sys/webidls/unstable/ResizeObserver.webidl32
-rw-r--r--vendor/web-sys/webidls/unstable/ScreenWakeLock.webidl23
-rw-r--r--vendor/web-sys/webidls/unstable/Share.webidl20
-rw-r--r--vendor/web-sys/webidls/unstable/WebCodecs.webidl478
-rw-r--r--vendor/web-sys/webidls/unstable/WebGPU.webidl1247
-rw-r--r--vendor/web-sys/webidls/unstable/WebHID.webidl127
-rw-r--r--vendor/web-sys/webidls/unstable/WebSerial.webidl80
-rw-r--r--vendor/web-sys/webidls/unstable/WebUSB.webidl243
-rw-r--r--vendor/web-sys/webidls/unstable/WebXRDevice.webidl297
-rw-r--r--vendor/web-sys/webidls/unstable/WebXRGamepadsModule.webidl11
-rw-r--r--vendor/web-sys/webidls/unstable/WebXRHandInputModule.webidl69
17 files changed, 3058 insertions, 0 deletions
diff --git a/vendor/web-sys/webidls/unstable/Bluetooth.webidl b/vendor/web-sys/webidls/unstable/Bluetooth.webidl
new file mode 100644
index 000000000..b5a1d64db
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/Bluetooth.webidl
@@ -0,0 +1,236 @@
+dictionary BluetoothDataFilterInit {
+ BufferSource dataPrefix;
+ BufferSource mask;
+};
+
+dictionary BluetoothLEScanFilterInit {
+ sequence<BluetoothServiceUUID> services;
+ DOMString name;
+ DOMString namePrefix;
+ // Maps unsigned shorts to BluetoothDataFilters.
+ object manufacturerData;
+ // Maps BluetoothServiceUUIDs to BluetoothDataFilters.
+ object serviceData;
+};
+
+dictionary RequestDeviceOptions {
+ sequence<BluetoothLEScanFilterInit> filters;
+ sequence<BluetoothServiceUUID> optionalServices = [];
+ boolean acceptAllDevices = false;
+};
+
+[Exposed=Window, SecureContext]
+interface Bluetooth : EventTarget {
+ Promise<boolean> getAvailability();
+ attribute EventHandler onavailabilitychanged;
+ [SameObject]
+ readonly attribute BluetoothDevice? referringDevice;
+ Promise<sequence<BluetoothDevice>> getDevices();
+ Promise<BluetoothDevice> requestDevice(RequestDeviceOptions options);
+};
+
+Bluetooth includes BluetoothDeviceEventHandlers;
+Bluetooth includes CharacteristicEventHandlers;
+Bluetooth includes ServiceEventHandlers;
+
+dictionary BluetoothPermissionDescriptor : PermissionDescriptor {
+ DOMString deviceId;
+ // These match RequestDeviceOptions.
+ sequence<BluetoothLEScanFilterInit> filters;
+ sequence<BluetoothServiceUUID> optionalServices = [];
+ boolean acceptAllDevices = false;
+};
+
+dictionary AllowedBluetoothDevice {
+ required DOMString deviceId;
+ required boolean mayUseGATT;
+ // An allowedServices of "all" means all services are allowed.
+ required (DOMString or sequence<UUID>) allowedServices;
+};
+dictionary BluetoothPermissionStorage {
+ required sequence<AllowedBluetoothDevice> allowedDevices;
+};
+
+[Exposed=Window]
+interface BluetoothPermissionResult : PermissionStatus {
+ attribute FrozenArray<BluetoothDevice> devices;
+};
+
+[
+ Exposed=Window,
+ SecureContext
+]
+interface ValueEvent : Event {
+ constructor(DOMString type, optional ValueEventInit initDict = {});
+ readonly attribute any value;
+};
+
+dictionary ValueEventInit : EventInit {
+ any value = null;
+};
+
+[Exposed=Window, SecureContext]
+interface BluetoothDevice : EventTarget {
+ readonly attribute DOMString id;
+ readonly attribute DOMString? name;
+ readonly attribute BluetoothRemoteGATTServer? gatt;
+
+ Promise<undefined> watchAdvertisements(
+ optional WatchAdvertisementsOptions options = {});
+ readonly attribute boolean watchingAdvertisements;
+};
+BluetoothDevice includes BluetoothDeviceEventHandlers;
+BluetoothDevice includes CharacteristicEventHandlers;
+BluetoothDevice includes ServiceEventHandlers;
+
+dictionary WatchAdvertisementsOptions {
+ AbortSignal signal;
+};
+
+[Exposed=Window, SecureContext]
+interface BluetoothManufacturerDataMap {
+ readonly maplike<unsigned short, DataView>;
+};
+[Exposed=Window, SecureContext]
+interface BluetoothServiceDataMap {
+ readonly maplike<UUID, DataView>;
+};
+[
+ Exposed=Window,
+ SecureContext
+]
+interface BluetoothAdvertisingEvent : Event {
+ constructor(DOMString type, BluetoothAdvertisingEventInit init);
+ [SameObject]
+ readonly attribute BluetoothDevice device;
+ readonly attribute FrozenArray<UUID> uuids;
+ readonly attribute DOMString? name;
+ readonly attribute unsigned short? appearance;
+ readonly attribute byte? txPower;
+ readonly attribute byte? rssi;
+ [SameObject]
+ readonly attribute BluetoothManufacturerDataMap manufacturerData;
+ [SameObject]
+ readonly attribute BluetoothServiceDataMap serviceData;
+};
+dictionary BluetoothAdvertisingEventInit : EventInit {
+ required BluetoothDevice device;
+ sequence<(DOMString or unsigned long)> uuids;
+ DOMString name;
+ unsigned short appearance;
+ byte txPower;
+ byte rssi;
+ BluetoothManufacturerDataMap manufacturerData;
+ BluetoothServiceDataMap serviceData;
+};
+
+[Exposed=Window, SecureContext]
+interface BluetoothRemoteGATTServer {
+ [SameObject]
+ readonly attribute BluetoothDevice device;
+ readonly attribute boolean connected;
+ Promise<BluetoothRemoteGATTServer> connect();
+ undefined disconnect();
+ Promise<BluetoothRemoteGATTService> getPrimaryService(BluetoothServiceUUID service);
+ Promise<sequence<BluetoothRemoteGATTService>>
+ getPrimaryServices(optional BluetoothServiceUUID service);
+};
+
+[Exposed=Window, SecureContext]
+interface BluetoothRemoteGATTService : EventTarget {
+ [SameObject]
+ readonly attribute BluetoothDevice device;
+ readonly attribute UUID uuid;
+ readonly attribute boolean isPrimary;
+ Promise<BluetoothRemoteGATTCharacteristic>
+ getCharacteristic(BluetoothCharacteristicUUID characteristic);
+ Promise<sequence<BluetoothRemoteGATTCharacteristic>>
+ getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
+ Promise<BluetoothRemoteGATTService>
+ getIncludedService(BluetoothServiceUUID service);
+ Promise<sequence<BluetoothRemoteGATTService>>
+ getIncludedServices(optional BluetoothServiceUUID service);
+};
+BluetoothRemoteGATTService includes CharacteristicEventHandlers;
+BluetoothRemoteGATTService includes ServiceEventHandlers;
+
+[Exposed=Window, SecureContext]
+interface BluetoothRemoteGATTCharacteristic : EventTarget {
+ [SameObject]
+ readonly attribute BluetoothRemoteGATTService service;
+ readonly attribute UUID uuid;
+ readonly attribute BluetoothCharacteristicProperties properties;
+ readonly attribute DataView? value;
+ Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
+ Promise<sequence<BluetoothRemoteGATTDescriptor>>
+ getDescriptors(optional BluetoothDescriptorUUID descriptor);
+ Promise<DataView> readValue();
+ Promise<undefined> writeValue(BufferSource value);
+ Promise<undefined> writeValueWithResponse(BufferSource value);
+ Promise<undefined> writeValueWithoutResponse(BufferSource value);
+ Promise<BluetoothRemoteGATTCharacteristic> startNotifications();
+ Promise<BluetoothRemoteGATTCharacteristic> stopNotifications();
+};
+BluetoothRemoteGATTCharacteristic includes CharacteristicEventHandlers;
+
+[Exposed=Window, SecureContext]
+interface BluetoothCharacteristicProperties {
+ readonly attribute boolean broadcast;
+ readonly attribute boolean read;
+ readonly attribute boolean writeWithoutResponse;
+ readonly attribute boolean write;
+ readonly attribute boolean notify;
+ readonly attribute boolean indicate;
+ readonly attribute boolean authenticatedSignedWrites;
+ readonly attribute boolean reliableWrite;
+ readonly attribute boolean writableAuxiliaries;
+};
+
+[Exposed=Window, SecureContext]
+interface BluetoothRemoteGATTDescriptor {
+ [SameObject]
+ readonly attribute BluetoothRemoteGATTCharacteristic characteristic;
+ readonly attribute UUID uuid;
+ readonly attribute DataView? value;
+ Promise<DataView> readValue();
+ Promise<undefined> writeValue(BufferSource value);
+};
+
+[SecureContext]
+interface mixin CharacteristicEventHandlers {
+ attribute EventHandler oncharacteristicvaluechanged;
+};
+
+[SecureContext]
+interface mixin BluetoothDeviceEventHandlers {
+ attribute EventHandler onadvertisementreceived;
+ attribute EventHandler ongattserverdisconnected;
+};
+
+[SecureContext]
+interface mixin ServiceEventHandlers {
+ attribute EventHandler onserviceadded;
+ attribute EventHandler onservicechanged;
+ attribute EventHandler onserviceremoved;
+};
+
+typedef DOMString UUID;
+
+[Exposed=Window]
+interface BluetoothUUID {
+ static UUID getService((DOMString or unsigned long) name);
+ static UUID getCharacteristic((DOMString or unsigned long) name);
+ static UUID getDescriptor((DOMString or unsigned long) name);
+
+ static UUID canonicalUUID([EnforceRange] unsigned long alias);
+};
+
+typedef (DOMString or unsigned long) BluetoothServiceUUID;
+typedef (DOMString or unsigned long) BluetoothCharacteristicUUID;
+typedef (DOMString or unsigned long) BluetoothDescriptorUUID;
+
+[SecureContext]
+partial interface Navigator {
+ [SameObject]
+ readonly attribute Bluetooth? bluetooth;
+};
diff --git a/vendor/web-sys/webidls/unstable/Clipboard.webidl b/vendor/web-sys/webidls/unstable/Clipboard.webidl
new file mode 100644
index 000000000..d1974f65e
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/Clipboard.webidl
@@ -0,0 +1,61 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * Clipboard API and events
+ * W3C Working Draft, 4 June 2021
+ * The origin of this IDL file is:
+ * https://www.w3.org/TR/2021/WD-clipboard-apis-20210604/
+ */
+
+dictionary ClipboardEventInit : EventInit {
+ DataTransfer? clipboardData = null;
+};
+
+[Exposed=Window]
+interface ClipboardEvent : Event {
+ constructor(DOMString type, optional ClipboardEventInit eventInitDict = {});
+ readonly attribute DataTransfer? clipboardData;
+};
+
+partial interface Navigator {
+ [SecureContext, SameObject] readonly attribute Clipboard? clipboard;
+};
+
+typedef sequence<ClipboardItem> ClipboardItems;
+
+[SecureContext, Exposed=Window] interface Clipboard : EventTarget {
+ Promise<ClipboardItems> read();
+ Promise<DOMString> readText();
+ Promise<undefined> write(ClipboardItems data);
+ Promise<undefined> writeText(DOMString data);
+};
+
+typedef (DOMString or Blob) ClipboardItemDataType;
+typedef Promise<ClipboardItemDataType> ClipboardItemData;
+
+callback ClipboardItemDelayedCallback = ClipboardItemData ();
+
+[Exposed=Window] interface ClipboardItem {
+ constructor(record<DOMString, ClipboardItemData> items,
+ optional ClipboardItemOptions options = {});
+ static ClipboardItem createDelayed(
+ record<DOMString, ClipboardItemDelayedCallback> items,
+ optional ClipboardItemOptions options = {});
+
+ readonly attribute PresentationStyle presentationStyle;
+ readonly attribute long long lastModified;
+ readonly attribute boolean delayed;
+
+ readonly attribute FrozenArray<DOMString> types;
+
+ Promise<Blob> getType(DOMString type);
+};
+
+enum PresentationStyle { "unspecified", "inline", "attachment" };
+
+dictionary ClipboardItemOptions {
+ PresentationStyle presentationStyle = "unspecified";
+};
+
+dictionary ClipboardPermissionDescriptor : PermissionDescriptor {
+ boolean allowWithoutGesture = false;
+};
diff --git a/vendor/web-sys/webidls/unstable/ImageCapture.webidl b/vendor/web-sys/webidls/unstable/ImageCapture.webidl
new file mode 100644
index 000000000..317a9dd6e
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/ImageCapture.webidl
@@ -0,0 +1,22 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/ImageCapture.html
+ *
+ * Copyright © 2012-2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+[Pref="dom.imagecapture.enabled", Constructor(MediaStreamTrack videoTrack)]
+interface ImageCapture {
+ Promise<Blob> takePhoto(optional PhotoSettings photoSettings);
+ Promise<PhotoCapabilities> getPhotoCapabilities();
+ Promise<PhotoSettings> getPhotoSettings();
+
+ Promise<ImageBitmap> grabFrame();
+
+ readonly attribute MediaStreamTrack track;
+};
diff --git a/vendor/web-sys/webidls/unstable/MediaCaptureTransform.webidl b/vendor/web-sys/webidls/unstable/MediaCaptureTransform.webidl
new file mode 100644
index 000000000..a81eee994
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/MediaCaptureTransform.webidl
@@ -0,0 +1,20 @@
+[Exposed=Window,DedicatedWorker]
+interface MediaStreamTrackGenerator : MediaStreamTrack {
+ constructor(MediaStreamTrackGeneratorInit init);
+ attribute WritableStream writable; // VideoFrame or AudioData
+};
+
+dictionary MediaStreamTrackGeneratorInit {
+ required DOMString kind;
+};
+
+[Exposed=DedicatedWorker]
+interface MediaStreamTrackProcessor {
+ constructor(MediaStreamTrackProcessorInit init);
+ attribute ReadableStream readable;
+};
+
+dictionary MediaStreamTrackProcessorInit {
+ required MediaStreamTrack track;
+ [EnforceRange] unsigned short maxBufferSize;
+};
diff --git a/vendor/web-sys/webidls/unstable/MediaSession.webidl b/vendor/web-sys/webidls/unstable/MediaSession.webidl
new file mode 100644
index 000000000..91133c682
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/MediaSession.webidl
@@ -0,0 +1,77 @@
+[Exposed=Window]
+partial interface Navigator {
+ [SameObject] readonly attribute MediaSession mediaSession;
+};
+
+enum MediaSessionPlaybackState {
+ "none",
+ "paused",
+ "playing"
+};
+
+enum MediaSessionAction {
+ "play",
+ "pause",
+ "seekbackward",
+ "seekforward",
+ "previoustrack",
+ "nexttrack",
+ "skipad",
+ "stop",
+ "seekto",
+ "togglemicrophone",
+ "togglecamera",
+ "hangup"
+};
+
+callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);
+
+[Exposed=Window]
+interface MediaSession {
+ attribute MediaMetadata? metadata;
+
+ attribute MediaSessionPlaybackState playbackState;
+
+ undefined setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);
+
+ undefined setPositionState(optional MediaPositionState state = {});
+
+ undefined setMicrophoneActive(boolean active);
+
+ undefined setCameraActive(boolean active);
+};
+
+[Exposed=Window]
+interface MediaMetadata {
+ constructor(optional MediaMetadataInit init = {});
+ attribute DOMString title;
+ attribute DOMString artist;
+ attribute DOMString album;
+ attribute FrozenArray<MediaImage> artwork;
+};
+
+dictionary MediaMetadataInit {
+ DOMString title = "";
+ DOMString artist = "";
+ DOMString album = "";
+ sequence<MediaImage> artwork = [];
+};
+
+dictionary MediaImage {
+ required USVString src;
+ DOMString sizes = "";
+ DOMString type = "";
+};
+
+dictionary MediaPositionState {
+ double duration;
+ double playbackRate;
+ double position;
+};
+
+dictionary MediaSessionActionDetails {
+ required MediaSessionAction action;
+ double? seekOffset;
+ double? seekTime;
+ boolean? fastSeek;
+};
diff --git a/vendor/web-sys/webidls/unstable/QueuingStrategy.webidl b/vendor/web-sys/webidls/unstable/QueuingStrategy.webidl
new file mode 100644
index 000000000..8138938c5
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/QueuingStrategy.webidl
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * Source: https://streams.spec.whatwg.org/#dictdef-queuingstrategy
+ */
+
+dictionary QueuingStrategy {
+ unrestricted double highWaterMark;
+ QueuingStrategySize size;
+};
+
+callback QueuingStrategySize = unrestricted double (optional any chunk);
diff --git a/vendor/web-sys/webidls/unstable/ResizeObserver.webidl b/vendor/web-sys/webidls/unstable/ResizeObserver.webidl
new file mode 100644
index 000000000..48876887d
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/ResizeObserver.webidl
@@ -0,0 +1,32 @@
+enum ResizeObserverBoxOptions {
+ "border-box", "content-box", "device-pixel-content-box"
+};
+
+dictionary ResizeObserverOptions {
+ ResizeObserverBoxOptions box = "content-box";
+};
+
+[Exposed=(Window)]
+interface ResizeObserver {
+ constructor(ResizeObserverCallback callback);
+ undefined observe(Element target, optional ResizeObserverOptions options = {});
+ undefined unobserve(Element target);
+ undefined disconnect();
+};
+
+callback ResizeObserverCallback = undefined (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
+
+[Exposed=Window]
+interface ResizeObserverEntry {
+ readonly attribute Element target;
+ readonly attribute DOMRectReadOnly contentRect;
+ readonly attribute FrozenArray<ResizeObserverSize> borderBoxSize;
+ readonly attribute FrozenArray<ResizeObserverSize> contentBoxSize;
+ readonly attribute FrozenArray<ResizeObserverSize> devicePixelContentBoxSize;
+};
+
+[Exposed=Window]
+interface ResizeObserverSize {
+ readonly attribute unrestricted double inlineSize;
+ readonly attribute unrestricted double blockSize;
+};
diff --git a/vendor/web-sys/webidls/unstable/ScreenWakeLock.webidl b/vendor/web-sys/webidls/unstable/ScreenWakeLock.webidl
new file mode 100644
index 000000000..c14d783d4
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/ScreenWakeLock.webidl
@@ -0,0 +1,23 @@
+/* The origin of this IDL file is
+ * https://www.w3.org/TR/screen-wake-lock/#idl-index
+ */
+
+[SecureContext]
+partial interface Navigator {
+ [SameObject] readonly attribute WakeLock wakeLock;
+};
+
+[SecureContext, Exposed=(Window)]
+interface WakeLock {
+ Promise<WakeLockSentinel> request(WakeLockType type);
+};
+
+[SecureContext, Exposed=(Window)]
+interface WakeLockSentinel : EventTarget {
+ readonly attribute boolean released;
+ readonly attribute WakeLockType type;
+ Promise<undefined> release();
+ attribute EventHandler onrelease;
+};
+
+enum WakeLockType { "screen" };
diff --git a/vendor/web-sys/webidls/unstable/Share.webidl b/vendor/web-sys/webidls/unstable/Share.webidl
new file mode 100644
index 000000000..570af69a8
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/Share.webidl
@@ -0,0 +1,20 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * API for sharing text, links and other content to an arbitrary destination of the user's choice.
+ * W3C Working Draft, 22 November 2021
+ * The origin of this IDL file is:
+ * https://www.w3.org/TR/web-share
+ */
+
+partial interface Navigator {
+ [SecureContext] Promise<undefined> share(optional ShareData data = {});
+
+ [SecureContext] boolean canShare(optional ShareData data = {});
+};
+
+dictionary ShareData {
+ sequence<File> files;
+ USVString title;
+ USVString text;
+ USVString url;
+};
diff --git a/vendor/web-sys/webidls/unstable/WebCodecs.webidl b/vendor/web-sys/webidls/unstable/WebCodecs.webidl
new file mode 100644
index 000000000..62c8618ab
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebCodecs.webidl
@@ -0,0 +1,478 @@
+[Exposed=(Window,DedicatedWorker), SecureContext]
+interface AudioDecoder {
+ constructor(AudioDecoderInit init);
+
+ readonly attribute CodecState state;
+ readonly attribute unsigned long decodeQueueSize;
+
+ undefined configure(AudioDecoderConfig config);
+ undefined decode(EncodedAudioChunk chunk);
+ Promise<undefined> flush();
+ undefined reset();
+ undefined close();
+
+ static Promise<AudioDecoderSupport> isConfigSupported(AudioDecoderConfig config);
+};
+
+dictionary AudioDecoderInit {
+ required AudioDataOutputCallback output;
+ required WebCodecsErrorCallback error;
+};
+
+callback AudioDataOutputCallback = undefined(AudioData output);
+
+[Exposed=(Window,DedicatedWorker), SecureContext]
+interface VideoDecoder {
+ constructor(VideoDecoderInit init);
+
+ readonly attribute CodecState state;
+ readonly attribute unsigned long decodeQueueSize;
+
+ undefined configure(VideoDecoderConfig config);
+ undefined decode(EncodedVideoChunk chunk);
+ Promise<undefined> flush();
+ undefined reset();
+ undefined close();
+
+ static Promise<VideoDecoderSupport> isConfigSupported(VideoDecoderConfig config);
+};
+
+dictionary VideoDecoderInit {
+ required VideoFrameOutputCallback output;
+ required WebCodecsErrorCallback error;
+};
+
+callback VideoFrameOutputCallback = undefined(VideoFrame output);
+
+[Exposed=(Window,DedicatedWorker), SecureContext]
+interface AudioEncoder {
+ constructor(AudioEncoderInit init);
+
+ readonly attribute CodecState state;
+ readonly attribute unsigned long encodeQueueSize;
+
+ undefined configure(AudioEncoderConfig config);
+ undefined encode(AudioData data);
+ Promise<undefined> flush();
+ undefined reset();
+ undefined close();
+
+ static Promise<AudioEncoderSupport> isConfigSupported(AudioEncoderConfig config);
+};
+
+dictionary AudioEncoderInit {
+ required EncodedAudioChunkOutputCallback output;
+ required WebCodecsErrorCallback error;
+};
+
+callback EncodedAudioChunkOutputCallback =
+ undefined (EncodedAudioChunk output,
+ optional EncodedAudioChunkMetadata metadata = {});
+
+dictionary EncodedAudioChunkMetadata {
+ AudioDecoderConfig decoderConfig;
+};
+
+[Exposed=(Window,DedicatedWorker), SecureContext]
+interface VideoEncoder {
+ constructor(VideoEncoderInit init);
+
+ readonly attribute CodecState state;
+ readonly attribute unsigned long encodeQueueSize;
+
+ undefined configure(VideoEncoderConfig config);
+ undefined encode(VideoFrame frame, optional VideoEncoderEncodeOptions options = {});
+ Promise<undefined> flush();
+ undefined reset();
+ undefined close();
+
+ static Promise<VideoEncoderSupport> isConfigSupported(VideoEncoderConfig config);
+};
+
+dictionary VideoEncoderInit {
+ required EncodedVideoChunkOutputCallback output;
+ required WebCodecsErrorCallback error;
+};
+
+callback EncodedVideoChunkOutputCallback =
+ undefined (EncodedVideoChunk chunk,
+ optional EncodedVideoChunkMetadata metadata = {});
+
+dictionary EncodedVideoChunkMetadata {
+ VideoDecoderConfig decoderConfig;
+ SvcOutputMetadata svc;
+ BufferSource alphaSideData;
+};
+
+dictionary SvcOutputMetadata {
+ unsigned long temporalLayerId;
+};
+
+dictionary AudioDecoderSupport {
+ boolean supported;
+ AudioDecoderConfig config;
+};
+
+dictionary VideoDecoderSupport {
+ boolean supported;
+ VideoDecoderConfig config;
+};
+
+dictionary AudioEncoderSupport {
+ boolean supported;
+ AudioEncoderConfig config;
+};
+
+dictionary VideoEncoderSupport {
+ boolean supported;
+ VideoEncoderConfig config;
+};
+
+dictionary AudioDecoderConfig {
+ required DOMString codec;
+ [EnforceRange] required unsigned long sampleRate;
+ [EnforceRange] required unsigned long numberOfChannels;
+ BufferSource description;
+};
+
+dictionary VideoDecoderConfig {
+ required DOMString codec;
+ BufferSource description;
+ [EnforceRange] unsigned long codedWidth;
+ [EnforceRange] unsigned long codedHeight;
+ [EnforceRange] unsigned long displayAspectWidth;
+ [EnforceRange] unsigned long displayAspectHeight;
+ VideoColorSpaceInit colorSpace;
+ HardwareAcceleration hardwareAcceleration = "no-preference";
+ boolean optimizeForLatency;
+};
+
+dictionary AudioEncoderConfig {
+ required DOMString codec;
+ [EnforceRange] unsigned long sampleRate;
+ [EnforceRange] unsigned long numberOfChannels;
+ [EnforceRange] unsigned long long bitrate;
+};
+
+dictionary VideoEncoderConfig {
+ required DOMString codec;
+ [EnforceRange] required unsigned long width;
+ [EnforceRange] required unsigned long height;
+ [EnforceRange] unsigned long displayWidth;
+ [EnforceRange] unsigned long displayHeight;
+ [EnforceRange] unsigned long long bitrate;
+ [EnforceRange] double framerate;
+ HardwareAcceleration hardwareAcceleration = "no-preference";
+ AlphaOption alpha = "discard";
+ DOMString scalabilityMode;
+ BitrateMode bitrateMode = "variable";
+ LatencyMode latencyMode = "quality";
+};
+
+enum HardwareAcceleration {
+ "no-preference",
+ "prefer-hardware",
+ "prefer-software",
+};
+
+enum AlphaOption {
+ "keep",
+ "discard",
+};
+
+enum LatencyMode {
+ "quality",
+ "realtime"
+};
+
+dictionary VideoEncoderEncodeOptions {
+ boolean keyFrame = false;
+};
+
+enum CodecState {
+ "unconfigured",
+ "configured",
+ "closed"
+};
+
+callback WebCodecsErrorCallback = undefined(DOMException error);
+
+[Exposed=(Window,DedicatedWorker)]
+interface EncodedAudioChunk {
+ constructor(EncodedAudioChunkInit init);
+ readonly attribute EncodedAudioChunkType type;
+ readonly attribute long long timestamp; // microseconds
+ readonly attribute unsigned long long? duration; // microseconds
+ readonly attribute unsigned long byteLength;
+
+ undefined copyTo([AllowShared] BufferSource destination);
+};
+
+dictionary EncodedAudioChunkInit {
+ required EncodedAudioChunkType type;
+ [EnforceRange] required long long timestamp; // microseconds
+ [EnforceRange] unsigned long long duration; // microseconds
+ required BufferSource data;
+};
+
+enum EncodedAudioChunkType {
+ "key",
+ "delta",
+};
+
+[Exposed=(Window,DedicatedWorker)]
+interface EncodedVideoChunk {
+ constructor(EncodedVideoChunkInit init);
+ readonly attribute EncodedVideoChunkType type;
+ readonly attribute long long timestamp; // microseconds
+ readonly attribute unsigned long long? duration; // microseconds
+ readonly attribute unsigned long byteLength;
+
+ undefined copyTo([AllowShared] BufferSource destination);
+};
+
+dictionary EncodedVideoChunkInit {
+ required EncodedVideoChunkType type;
+ [EnforceRange] required long long timestamp; // microseconds
+ [EnforceRange] unsigned long long duration; // microseconds
+ required BufferSource data;
+};
+
+enum EncodedVideoChunkType {
+ "key",
+ "delta",
+};
+
+[Exposed=(Window,DedicatedWorker), Serializable, Transferable]
+interface AudioData {
+ constructor(AudioDataInit init);
+
+ readonly attribute AudioSampleFormat? format;
+ readonly attribute float sampleRate;
+ readonly attribute unsigned long numberOfFrames;
+ readonly attribute unsigned long numberOfChannels;
+ readonly attribute unsigned long long duration; // microseconds
+ readonly attribute long long timestamp; // microseconds
+
+ unsigned long allocationSize(AudioDataCopyToOptions options);
+ undefined copyTo([AllowShared] BufferSource destination, AudioDataCopyToOptions options);
+ AudioData clone();
+ undefined close();
+};
+
+dictionary AudioDataInit {
+ required AudioSampleFormat format;
+ required float sampleRate;
+ [EnforceRange] required unsigned long numberOfFrames;
+ [EnforceRange] required unsigned long numberOfChannels;
+ [EnforceRange] required long long timestamp; // microseconds
+ required BufferSource data;
+};
+
+dictionary AudioDataCopyToOptions {
+ [EnforceRange] required unsigned long planeIndex;
+ [EnforceRange] unsigned long frameOffset = 0;
+ [EnforceRange] unsigned long frameCount;
+ AudioSampleFormat format;
+};
+
+enum AudioSampleFormat {
+ "u8",
+ "s16",
+ "s32",
+ "f32",
+ "u8-planar",
+ "s16-planar",
+ "s32-planar",
+ "f32-planar",
+};
+
+[Exposed=(Window,DedicatedWorker), Serializable, Transferable]
+interface VideoFrame {
+ constructor(CanvasImageSource image, optional VideoFrameInit init = {});
+ constructor([AllowShared] BufferSource data, VideoFrameBufferInit init);
+
+ readonly attribute VideoPixelFormat? format;
+ readonly attribute unsigned long codedWidth;
+ readonly attribute unsigned long codedHeight;
+ readonly attribute DOMRectReadOnly? codedRect;
+ readonly attribute DOMRectReadOnly? visibleRect;
+ readonly attribute unsigned long displayWidth;
+ readonly attribute unsigned long displayHeight;
+ readonly attribute unsigned long long? duration; // microseconds
+ readonly attribute long long? timestamp; // microseconds
+ readonly attribute VideoColorSpace colorSpace;
+
+ unsigned long allocationSize(
+ optional VideoFrameCopyToOptions options = {});
+ Promise<sequence<PlaneLayout>> copyTo(
+ [AllowShared] BufferSource destination,
+ optional VideoFrameCopyToOptions options = {});
+ VideoFrame clone();
+ undefined close();
+};
+
+dictionary VideoFrameInit {
+ unsigned long long duration; // microseconds
+ long long timestamp; // microseconds
+ AlphaOption alpha = "keep";
+
+ // Default matches image. May be used to efficiently crop. Will trigger
+ // new computation of displayWidth and displayHeight using image’s pixel
+ // aspect ratio unless an explicit displayWidth and displayHeight are given.
+ DOMRectInit visibleRect;
+
+ // Default matches image unless visibleRect is provided.
+ [EnforceRange] unsigned long displayWidth;
+ [EnforceRange] unsigned long displayHeight;
+};
+
+dictionary VideoFrameBufferInit {
+ required VideoPixelFormat format;
+ [EnforceRange] required unsigned long codedWidth;
+ [EnforceRange] required unsigned long codedHeight;
+ [EnforceRange] required long long timestamp; // microseconds
+ [EnforceRange] unsigned long long duration; // microseconds
+
+ // Default layout is tightly-packed.
+ sequence<PlaneLayout> layout;
+
+ // Default visible rect is coded size positioned at (0,0)
+ DOMRectInit visibleRect;
+
+ // Default display dimensions match visibleRect.
+ [EnforceRange] unsigned long displayWidth;
+ [EnforceRange] unsigned long displayHeight;
+
+ VideoColorSpaceInit colorSpace;
+};
+
+dictionary VideoFrameCopyToOptions {
+ DOMRectInit rect;
+ sequence<PlaneLayout> layout;
+};
+
+dictionary PlaneLayout {
+ [EnforceRange] required unsigned long offset;
+ [EnforceRange] required unsigned long stride;
+};
+
+enum VideoPixelFormat {
+ // 4:2:0 Y, U, V
+ "I420",
+ // 4:2:0 Y, U, V, A
+ "I420A",
+ // 4:2:2 Y, U, V
+ "I422",
+ // 4:4:4 Y, U, V
+ "I444",
+ // 4:2:0 Y, UV
+ "NV12",
+ // 32bpp RGBA
+ "RGBA",
+ // 32bpp RGBX (opaque)
+ "RGBX",
+ // 32bpp BGRA
+ "BGRA",
+ // 32bpp BGRX (opaque)
+ "BGRX",
+};
+
+[Exposed=(Window,DedicatedWorker)]
+interface VideoColorSpace {
+ constructor(optional VideoColorSpaceInit init = {});
+
+ readonly attribute VideoColorPrimaries? primaries;
+ readonly attribute VideoTransferCharacteristics? transfer;
+ readonly attribute VideoMatrixCoefficients? matrix;
+ readonly attribute boolean? fullRange;
+
+ [Default] VideoColorSpaceInit toJSON();
+};
+
+dictionary VideoColorSpaceInit {
+ VideoColorPrimaries primaries;
+ VideoTransferCharacteristics transfer;
+ VideoMatrixCoefficients matrix;
+ boolean fullRange;
+};
+
+enum VideoColorPrimaries {
+ "bt709", // BT.709, sRGB
+ "bt470bg", // BT.601 PAL
+ "smpte170m", // BT.601 NTSC
+};
+
+enum VideoTransferCharacteristics {
+ "bt709", // BT.709
+ "smpte170m", // BT.601 (functionally the same as bt709)
+ "iec61966-2-1", // sRGB
+};
+
+enum VideoMatrixCoefficients {
+ "rgb", // sRGB
+ "bt709", // BT.709
+ "bt470bg", // BT.601 PAL
+ "smpte170m", // BT.601 NTSC (functionally the same as bt470bg)
+};
+
+[Exposed=(Window,DedicatedWorker), SecureContext]
+interface ImageDecoder {
+ constructor(ImageDecoderInit init);
+
+ readonly attribute DOMString type;
+ readonly attribute boolean complete;
+ readonly attribute Promise<undefined> completed;
+ readonly attribute ImageTrackList tracks;
+
+ Promise<ImageDecodeResult> decode(optional ImageDecodeOptions options = {});
+ undefined reset();
+ undefined close();
+
+ static Promise<boolean> isTypeSupported(DOMString type);
+};
+
+
+typedef (BufferSource or ReadableStream) ImageBufferSource;
+dictionary ImageDecoderInit {
+ required DOMString type;
+ required ImageBufferSource data;
+ PremultiplyAlpha premultiplyAlpha = "default";
+ ColorSpaceConversion colorSpaceConversion = "default";
+ [EnforceRange] unsigned long desiredWidth;
+ [EnforceRange] unsigned long desiredHeight;
+ boolean preferAnimation;
+};
+
+
+dictionary ImageDecodeOptions {
+ [EnforceRange] unsigned long frameIndex = 0;
+ boolean completeFramesOnly = true;
+};
+
+
+dictionary ImageDecodeResult {
+ required VideoFrame image;
+ required boolean complete;
+};
+
+
+[Exposed=(Window,DedicatedWorker)]
+interface ImageTrackList {
+ getter ImageTrack (unsigned long index);
+
+ readonly attribute Promise<undefined> ready;
+ readonly attribute unsigned long length;
+ readonly attribute long selectedIndex;
+ readonly attribute ImageTrack? selectedTrack;
+};
+
+
+[Exposed=(Window,DedicatedWorker)]
+interface ImageTrack : EventTarget {
+ readonly attribute boolean animated;
+ readonly attribute unsigned long frameCount;
+ readonly attribute unrestricted float repetitionCount;
+ attribute EventHandler onchange;
+ attribute boolean selected;
+};
diff --git a/vendor/web-sys/webidls/unstable/WebGPU.webidl b/vendor/web-sys/webidls/unstable/WebGPU.webidl
new file mode 100644
index 000000000..e481dd5d9
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebGPU.webidl
@@ -0,0 +1,1247 @@
+interface mixin GPUObjectBase {
+ attribute USVString label;
+};
+
+dictionary GPUObjectDescriptorBase {
+ USVString label;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUSupportedLimits {
+ readonly attribute unsigned long maxTextureDimension1D;
+ readonly attribute unsigned long maxTextureDimension2D;
+ readonly attribute unsigned long maxTextureDimension3D;
+ readonly attribute unsigned long maxTextureArrayLayers;
+ readonly attribute unsigned long maxBindGroups;
+ readonly attribute unsigned long maxBindingsPerBindGroup;
+ readonly attribute unsigned long maxDynamicUniformBuffersPerPipelineLayout;
+ readonly attribute unsigned long maxDynamicStorageBuffersPerPipelineLayout;
+ readonly attribute unsigned long maxSampledTexturesPerShaderStage;
+ readonly attribute unsigned long maxSamplersPerShaderStage;
+ readonly attribute unsigned long maxStorageBuffersPerShaderStage;
+ readonly attribute unsigned long maxStorageTexturesPerShaderStage;
+ readonly attribute unsigned long maxUniformBuffersPerShaderStage;
+ readonly attribute unsigned long long maxUniformBufferBindingSize;
+ readonly attribute unsigned long long maxStorageBufferBindingSize;
+ readonly attribute unsigned long minUniformBufferOffsetAlignment;
+ readonly attribute unsigned long minStorageBufferOffsetAlignment;
+ readonly attribute unsigned long maxVertexBuffers;
+ readonly attribute unsigned long long maxBufferSize;
+ readonly attribute unsigned long maxVertexAttributes;
+ readonly attribute unsigned long maxVertexBufferArrayStride;
+ readonly attribute unsigned long maxInterStageShaderComponents;
+ readonly attribute unsigned long maxInterStageShaderVariables;
+ readonly attribute unsigned long maxColorAttachments;
+ readonly attribute unsigned long maxColorAttachmentBytesPerPixel;
+ readonly attribute unsigned long maxComputeWorkgroupStorageSize;
+ readonly attribute unsigned long maxComputeInvocationsPerWorkgroup;
+ readonly attribute unsigned long maxComputeWorkgroupSizeX;
+ readonly attribute unsigned long maxComputeWorkgroupSizeY;
+ readonly attribute unsigned long maxComputeWorkgroupSizeZ;
+ readonly attribute unsigned long maxComputeWorkgroupsPerDimension;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUSupportedFeatures {
+ readonly setlike<DOMString>;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUAdapterInfo {
+ readonly attribute DOMString vendor;
+ readonly attribute DOMString architecture;
+ readonly attribute DOMString device;
+ readonly attribute DOMString description;
+};
+
+interface mixin NavigatorGPU {
+ [SameObject, SecureContext] readonly attribute GPU gpu;
+};
+Navigator includes NavigatorGPU;
+WorkerNavigator includes NavigatorGPU;
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPU {
+ Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {});
+ GPUTextureFormat getPreferredCanvasFormat();
+};
+
+dictionary GPURequestAdapterOptions {
+ GPUPowerPreference powerPreference;
+ boolean forceFallbackAdapter = false;
+};
+
+enum GPUPowerPreference {
+ "low-power",
+ "high-performance"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUAdapter {
+ [SameObject] readonly attribute GPUSupportedFeatures features;
+ [SameObject] readonly attribute GPUSupportedLimits limits;
+ readonly attribute boolean isFallbackAdapter;
+
+ Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
+ Promise<GPUAdapterInfo> requestAdapterInfo(optional sequence<DOMString> unmaskHints = []);
+};
+
+dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase {
+ sequence<GPUFeatureName> requiredFeatures = [];
+ record<DOMString, GPUSize64> requiredLimits = {};
+ GPUQueueDescriptor defaultQueue = {};
+};
+
+enum GPUFeatureName {
+ "depth-clip-control",
+ "depth32float-stencil8",
+ "texture-compression-bc",
+ "texture-compression-etc2",
+ "texture-compression-astc",
+ "timestamp-query",
+ "indirect-first-instance",
+ "shader-f16",
+ "bgra8unorm-storage",
+ "rg11b10ufloat-renderable"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUDevice : EventTarget {
+ [SameObject] readonly attribute GPUSupportedFeatures features;
+ [SameObject] readonly attribute GPUSupportedLimits limits;
+
+ [SameObject] readonly attribute GPUQueue queue;
+
+ undefined destroy();
+
+ GPUBuffer createBuffer(GPUBufferDescriptor descriptor);
+ GPUTexture createTexture(GPUTextureDescriptor descriptor);
+ GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {});
+ GPUExternalTexture importExternalTexture(GPUExternalTextureDescriptor descriptor);
+
+ GPUBindGroupLayout createBindGroupLayout(GPUBindGroupLayoutDescriptor descriptor);
+ GPUPipelineLayout createPipelineLayout(GPUPipelineLayoutDescriptor descriptor);
+ GPUBindGroup createBindGroup(GPUBindGroupDescriptor descriptor);
+
+ GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor);
+ GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor);
+ GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor);
+ Promise<GPUComputePipeline> createComputePipelineAsync(GPUComputePipelineDescriptor descriptor);
+ Promise<GPURenderPipeline> createRenderPipelineAsync(GPURenderPipelineDescriptor descriptor);
+
+ GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
+ GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor);
+
+ GPUQuerySet createQuerySet(GPUQuerySetDescriptor descriptor);
+};
+GPUDevice includes GPUObjectBase;
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUBuffer {
+ readonly attribute GPUSize64 size;
+ readonly attribute GPUBufferUsageFlags usage;
+
+ readonly attribute GPUBufferMapState mapState;
+
+ Promise<undefined> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size);
+ ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size);
+ undefined unmap();
+
+ undefined destroy();
+};
+GPUBuffer includes GPUObjectBase;
+
+enum GPUBufferMapState {
+ "unmapped",
+ "pending",
+ "mapped"
+};
+
+dictionary GPUBufferDescriptor : GPUObjectDescriptorBase {
+ required GPUSize64 size;
+ required GPUBufferUsageFlags usage;
+ boolean mappedAtCreation = false;
+};
+
+typedef [EnforceRange] unsigned long GPUBufferUsageFlags;
+[Exposed=(Window, DedicatedWorker)]
+namespace GPUBufferUsage {
+ const GPUFlagsConstant MAP_READ = 0x0001;
+ const GPUFlagsConstant MAP_WRITE = 0x0002;
+ const GPUFlagsConstant COPY_SRC = 0x0004;
+ const GPUFlagsConstant COPY_DST = 0x0008;
+ const GPUFlagsConstant INDEX = 0x0010;
+ const GPUFlagsConstant VERTEX = 0x0020;
+ const GPUFlagsConstant UNIFORM = 0x0040;
+ const GPUFlagsConstant STORAGE = 0x0080;
+ const GPUFlagsConstant INDIRECT = 0x0100;
+ const GPUFlagsConstant QUERY_RESOLVE = 0x0200;
+};
+
+typedef [EnforceRange] unsigned long GPUMapModeFlags;
+[Exposed=(Window, DedicatedWorker)]
+namespace GPUMapMode {
+ const GPUFlagsConstant READ = 0x0001;
+ const GPUFlagsConstant WRITE = 0x0002;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUTexture {
+ GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {});
+
+ undefined destroy();
+
+ readonly attribute GPUIntegerCoordinate width;
+ readonly attribute GPUIntegerCoordinate height;
+ readonly attribute GPUIntegerCoordinate depthOrArrayLayers;
+ readonly attribute GPUIntegerCoordinate mipLevelCount;
+ readonly attribute GPUSize32 sampleCount;
+ readonly attribute GPUTextureDimension dimension;
+ readonly attribute GPUTextureFormat format;
+ readonly attribute GPUTextureUsageFlags usage;
+};
+GPUTexture includes GPUObjectBase;
+
+dictionary GPUTextureDescriptor : GPUObjectDescriptorBase {
+ required GPUExtent3D size;
+ GPUIntegerCoordinate mipLevelCount = 1;
+ GPUSize32 sampleCount = 1;
+ GPUTextureDimension dimension = "2d";
+ required GPUTextureFormat format;
+ required GPUTextureUsageFlags usage;
+ sequence<GPUTextureFormat> viewFormats = [];
+};
+
+enum GPUTextureDimension {
+ "1d",
+ "2d",
+ "3d"
+};
+
+typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
+[Exposed=(Window, DedicatedWorker)]
+namespace GPUTextureUsage {
+ const GPUFlagsConstant COPY_SRC = 0x01;
+ const GPUFlagsConstant COPY_DST = 0x02;
+ const GPUFlagsConstant TEXTURE_BINDING = 0x04;
+ const GPUFlagsConstant STORAGE_BINDING = 0x08;
+ const GPUFlagsConstant RENDER_ATTACHMENT = 0x10;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUTextureView {
+};
+GPUTextureView includes GPUObjectBase;
+
+dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase {
+ GPUTextureFormat format;
+ GPUTextureViewDimension dimension;
+ GPUTextureAspect aspect = "all";
+ GPUIntegerCoordinate baseMipLevel = 0;
+ GPUIntegerCoordinate mipLevelCount;
+ GPUIntegerCoordinate baseArrayLayer = 0;
+ GPUIntegerCoordinate arrayLayerCount;
+};
+
+enum GPUTextureViewDimension {
+ "1d",
+ "2d",
+ "2d-array",
+ "cube",
+ "cube-array",
+ "3d"
+};
+
+enum GPUTextureAspect {
+ "all",
+ "stencil-only",
+ "depth-only"
+};
+
+enum GPUTextureFormat {
+ // 8-bit formats
+ "r8unorm",
+ "r8snorm",
+ "r8uint",
+ "r8sint",
+
+ // 16-bit formats
+ "r16uint",
+ "r16sint",
+ "r16float",
+ "rg8unorm",
+ "rg8snorm",
+ "rg8uint",
+ "rg8sint",
+
+ // 32-bit formats
+ "r32uint",
+ "r32sint",
+ "r32float",
+ "rg16uint",
+ "rg16sint",
+ "rg16float",
+ "rgba8unorm",
+ "rgba8unorm-srgb",
+ "rgba8snorm",
+ "rgba8uint",
+ "rgba8sint",
+ "bgra8unorm",
+ "bgra8unorm-srgb",
+ // Packed 32-bit formats
+ "rgb9e5ufloat",
+ "rgb10a2unorm",
+ "rg11b10ufloat",
+
+ // 64-bit formats
+ "rg32uint",
+ "rg32sint",
+ "rg32float",
+ "rgba16uint",
+ "rgba16sint",
+ "rgba16float",
+
+ // 128-bit formats
+ "rgba32uint",
+ "rgba32sint",
+ "rgba32float",
+
+ // Depth/stencil formats
+ "stencil8",
+ "depth16unorm",
+ "depth24plus",
+ "depth24plus-stencil8",
+ "depth32float",
+
+ // "depth32float-stencil8" feature
+ "depth32float-stencil8",
+
+ // BC compressed formats usable if "texture-compression-bc" is both
+ // supported by the device/user agent and enabled in requestDevice.
+ "bc1-rgba-unorm",
+ "bc1-rgba-unorm-srgb",
+ "bc2-rgba-unorm",
+ "bc2-rgba-unorm-srgb",
+ "bc3-rgba-unorm",
+ "bc3-rgba-unorm-srgb",
+ "bc4-r-unorm",
+ "bc4-r-snorm",
+ "bc5-rg-unorm",
+ "bc5-rg-snorm",
+ "bc6h-rgb-ufloat",
+ "bc6h-rgb-float",
+ "bc7-rgba-unorm",
+ "bc7-rgba-unorm-srgb",
+
+ // ETC2 compressed formats usable if "texture-compression-etc2" is both
+ // supported by the device/user agent and enabled in requestDevice.
+ "etc2-rgb8unorm",
+ "etc2-rgb8unorm-srgb",
+ "etc2-rgb8a1unorm",
+ "etc2-rgb8a1unorm-srgb",
+ "etc2-rgba8unorm",
+ "etc2-rgba8unorm-srgb",
+ "eac-r11unorm",
+ "eac-r11snorm",
+ "eac-rg11unorm",
+ "eac-rg11snorm",
+
+ // ASTC compressed formats usable if "texture-compression-astc" is both
+ // supported by the device/user agent and enabled in requestDevice.
+ "astc-4x4-unorm",
+ "astc-4x4-unorm-srgb",
+ "astc-5x4-unorm",
+ "astc-5x4-unorm-srgb",
+ "astc-5x5-unorm",
+ "astc-5x5-unorm-srgb",
+ "astc-6x5-unorm",
+ "astc-6x5-unorm-srgb",
+ "astc-6x6-unorm",
+ "astc-6x6-unorm-srgb",
+ "astc-8x5-unorm",
+ "astc-8x5-unorm-srgb",
+ "astc-8x6-unorm",
+ "astc-8x6-unorm-srgb",
+ "astc-8x8-unorm",
+ "astc-8x8-unorm-srgb",
+ "astc-10x5-unorm",
+ "astc-10x5-unorm-srgb",
+ "astc-10x6-unorm",
+ "astc-10x6-unorm-srgb",
+ "astc-10x8-unorm",
+ "astc-10x8-unorm-srgb",
+ "astc-10x10-unorm",
+ "astc-10x10-unorm-srgb",
+ "astc-12x10-unorm",
+ "astc-12x10-unorm-srgb",
+ "astc-12x12-unorm",
+ "astc-12x12-unorm-srgb"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUExternalTexture {
+ readonly attribute boolean expired;
+};
+GPUExternalTexture includes GPUObjectBase;
+
+dictionary GPUExternalTextureDescriptor : GPUObjectDescriptorBase {
+ required HTMLVideoElement source;
+ PredefinedColorSpace colorSpace = "srgb";
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUSampler {
+};
+GPUSampler includes GPUObjectBase;
+
+dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
+ GPUAddressMode addressModeU = "clamp-to-edge";
+ GPUAddressMode addressModeV = "clamp-to-edge";
+ GPUAddressMode addressModeW = "clamp-to-edge";
+ GPUFilterMode magFilter = "nearest";
+ GPUFilterMode minFilter = "nearest";
+ GPUMipmapFilterMode mipmapFilter = "nearest";
+ float lodMinClamp = 0;
+ float lodMaxClamp = 32;
+ GPUCompareFunction compare;
+ [Clamp] unsigned short maxAnisotropy = 1;
+};
+
+enum GPUAddressMode {
+ "clamp-to-edge",
+ "repeat",
+ "mirror-repeat"
+};
+
+enum GPUFilterMode {
+ "nearest",
+ "linear"
+};
+
+enum GPUMipmapFilterMode {
+ "nearest",
+ "linear"
+};
+
+enum GPUCompareFunction {
+ "never",
+ "less",
+ "equal",
+ "less-equal",
+ "greater",
+ "not-equal",
+ "greater-equal",
+ "always"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUBindGroupLayout {
+};
+GPUBindGroupLayout includes GPUObjectBase;
+
+dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase {
+ required sequence<GPUBindGroupLayoutEntry> entries;
+};
+
+dictionary GPUBindGroupLayoutEntry {
+ required GPUIndex32 binding;
+ required GPUShaderStageFlags visibility;
+
+ GPUBufferBindingLayout buffer;
+ GPUSamplerBindingLayout sampler;
+ GPUTextureBindingLayout texture;
+ GPUStorageTextureBindingLayout storageTexture;
+ GPUExternalTextureBindingLayout externalTexture;
+};
+
+typedef [EnforceRange] unsigned long GPUShaderStageFlags;
+[Exposed=(Window, DedicatedWorker)]
+namespace GPUShaderStage {
+ const GPUFlagsConstant VERTEX = 0x1;
+ const GPUFlagsConstant FRAGMENT = 0x2;
+ const GPUFlagsConstant COMPUTE = 0x4;
+};
+
+enum GPUBufferBindingType {
+ "uniform",
+ "storage",
+ "read-only-storage"
+};
+
+dictionary GPUBufferBindingLayout {
+ GPUBufferBindingType type = "uniform";
+ boolean hasDynamicOffset = false;
+ GPUSize64 minBindingSize = 0;
+};
+
+enum GPUSamplerBindingType {
+ "filtering",
+ "non-filtering",
+ "comparison"
+};
+
+dictionary GPUSamplerBindingLayout {
+ GPUSamplerBindingType type = "filtering";
+};
+
+enum GPUTextureSampleType {
+ "float",
+ "unfilterable-float",
+ "depth",
+ "sint",
+ "uint"
+};
+
+dictionary GPUTextureBindingLayout {
+ GPUTextureSampleType sampleType = "float";
+ GPUTextureViewDimension viewDimension = "2d";
+ boolean multisampled = false;
+};
+
+enum GPUStorageTextureAccess {
+ "write-only"
+};
+
+dictionary GPUStorageTextureBindingLayout {
+ GPUStorageTextureAccess access = "write-only";
+ required GPUTextureFormat format;
+ GPUTextureViewDimension viewDimension = "2d";
+};
+
+dictionary GPUExternalTextureBindingLayout {
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUBindGroup {
+};
+GPUBindGroup includes GPUObjectBase;
+
+dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase {
+ required GPUBindGroupLayout layout;
+ required sequence<GPUBindGroupEntry> entries;
+};
+
+typedef (GPUSampler or GPUTextureView or GPUBufferBinding or GPUExternalTexture) GPUBindingResource;
+
+dictionary GPUBindGroupEntry {
+ required GPUIndex32 binding;
+ required GPUBindingResource resource;
+};
+
+dictionary GPUBufferBinding {
+ required GPUBuffer buffer;
+ GPUSize64 offset = 0;
+ GPUSize64 size;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUPipelineLayout {
+};
+GPUPipelineLayout includes GPUObjectBase;
+
+dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase {
+ required sequence<GPUBindGroupLayout> bindGroupLayouts;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUShaderModule {
+ Promise<GPUCompilationInfo> compilationInfo();
+};
+GPUShaderModule includes GPUObjectBase;
+
+dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase {
+ required USVString code;
+ object sourceMap;
+ record<USVString, GPUShaderModuleCompilationHint> hints;
+};
+
+dictionary GPUShaderModuleCompilationHint {
+ (GPUPipelineLayout or GPUAutoLayoutMode) layout;
+};
+
+enum GPUCompilationMessageType {
+ "error",
+ "warning",
+ "info"
+};
+
+[Exposed=(Window, DedicatedWorker), Serializable, SecureContext]
+interface GPUCompilationMessage {
+ readonly attribute DOMString message;
+ readonly attribute GPUCompilationMessageType type;
+ readonly attribute unsigned long long lineNum;
+ readonly attribute unsigned long long linePos;
+ readonly attribute unsigned long long offset;
+ readonly attribute unsigned long long length;
+};
+
+[Exposed=(Window, DedicatedWorker), Serializable, SecureContext]
+interface GPUCompilationInfo {
+ readonly attribute FrozenArray<GPUCompilationMessage> messages;
+};
+
+enum GPUAutoLayoutMode {
+ "auto"
+};
+
+dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase {
+ required (GPUPipelineLayout or GPUAutoLayoutMode) layout;
+};
+
+interface mixin GPUPipelineBase {
+ [NewObject] GPUBindGroupLayout getBindGroupLayout(unsigned long index);
+};
+
+dictionary GPUProgrammableStage {
+ required GPUShaderModule module;
+ required USVString entryPoint;
+ record<USVString, GPUPipelineConstantValue> constants;
+};
+
+typedef double GPUPipelineConstantValue; // May represent WGSL’s bool, f32, i32, u32, and f16 if enabled.
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUComputePipeline {
+};
+GPUComputePipeline includes GPUObjectBase;
+GPUComputePipeline includes GPUPipelineBase;
+
+dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase {
+ required GPUProgrammableStage compute;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPURenderPipeline {
+};
+GPURenderPipeline includes GPUObjectBase;
+GPURenderPipeline includes GPUPipelineBase;
+
+dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
+ required GPUVertexState vertex;
+ GPUPrimitiveState primitive = {};
+ GPUDepthStencilState depthStencil;
+ GPUMultisampleState multisample = {};
+ GPUFragmentState fragment;
+};
+
+dictionary GPUPrimitiveState {
+ GPUPrimitiveTopology topology = "triangle-list";
+ GPUIndexFormat stripIndexFormat;
+ GPUFrontFace frontFace = "ccw";
+ GPUCullMode cullMode = "none";
+
+ // Requires "depth-clip-control" feature.
+ boolean unclippedDepth = false;
+};
+
+enum GPUPrimitiveTopology {
+ "point-list",
+ "line-list",
+ "line-strip",
+ "triangle-list",
+ "triangle-strip"
+};
+
+enum GPUFrontFace {
+ "ccw",
+ "cw"
+};
+
+enum GPUCullMode {
+ "none",
+ "front",
+ "back"
+};
+
+dictionary GPUMultisampleState {
+ GPUSize32 count = 1;
+ GPUSampleMask mask = 0xFFFFFFFF;
+ boolean alphaToCoverageEnabled = false;
+};
+
+dictionary GPUFragmentState : GPUProgrammableStage {
+ required sequence<GPUColorTargetState?> targets;
+};
+
+dictionary GPUColorTargetState {
+ required GPUTextureFormat format;
+
+ GPUBlendState blend;
+ GPUColorWriteFlags writeMask = 0xF; // GPUColorWrite.ALL
+};
+
+dictionary GPUBlendState {
+ required GPUBlendComponent color;
+ required GPUBlendComponent alpha;
+};
+
+typedef [EnforceRange] unsigned long GPUColorWriteFlags;
+[Exposed=(Window, DedicatedWorker)]
+namespace GPUColorWrite {
+ const GPUFlagsConstant RED = 0x1;
+ const GPUFlagsConstant GREEN = 0x2;
+ const GPUFlagsConstant BLUE = 0x4;
+ const GPUFlagsConstant ALPHA = 0x8;
+ const GPUFlagsConstant ALL = 0xF;
+};
+
+dictionary GPUBlendComponent {
+ GPUBlendOperation operation = "add";
+ GPUBlendFactor srcFactor = "one";
+ GPUBlendFactor dstFactor = "zero";
+};
+
+enum GPUBlendFactor {
+ "zero",
+ "one",
+ "src",
+ "one-minus-src",
+ "src-alpha",
+ "one-minus-src-alpha",
+ "dst",
+ "one-minus-dst",
+ "dst-alpha",
+ "one-minus-dst-alpha",
+ "src-alpha-saturated",
+ "constant",
+ "one-minus-constant"
+};
+
+enum GPUBlendOperation {
+ "add",
+ "subtract",
+ "reverse-subtract",
+ "min",
+ "max"
+};
+
+dictionary GPUDepthStencilState {
+ required GPUTextureFormat format;
+
+ boolean depthWriteEnabled = false;
+ GPUCompareFunction depthCompare = "always";
+
+ GPUStencilFaceState stencilFront = {};
+ GPUStencilFaceState stencilBack = {};
+
+ GPUStencilValue stencilReadMask = 0xFFFFFFFF;
+ GPUStencilValue stencilWriteMask = 0xFFFFFFFF;
+
+ GPUDepthBias depthBias = 0;
+ float depthBiasSlopeScale = 0;
+ float depthBiasClamp = 0;
+};
+
+dictionary GPUStencilFaceState {
+ GPUCompareFunction compare = "always";
+ GPUStencilOperation failOp = "keep";
+ GPUStencilOperation depthFailOp = "keep";
+ GPUStencilOperation passOp = "keep";
+};
+
+enum GPUStencilOperation {
+ "keep",
+ "zero",
+ "replace",
+ "invert",
+ "increment-clamp",
+ "decrement-clamp",
+ "increment-wrap",
+ "decrement-wrap"
+};
+
+enum GPUIndexFormat {
+ "uint16",
+ "uint32"
+};
+
+enum GPUVertexFormat {
+ "uint8x2",
+ "uint8x4",
+ "sint8x2",
+ "sint8x4",
+ "unorm8x2",
+ "unorm8x4",
+ "snorm8x2",
+ "snorm8x4",
+ "uint16x2",
+ "uint16x4",
+ "sint16x2",
+ "sint16x4",
+ "unorm16x2",
+ "unorm16x4",
+ "snorm16x2",
+ "snorm16x4",
+ "float16x2",
+ "float16x4",
+ "float32",
+ "float32x2",
+ "float32x3",
+ "float32x4",
+ "uint32",
+ "uint32x2",
+ "uint32x3",
+ "uint32x4",
+ "sint32",
+ "sint32x2",
+ "sint32x3",
+ "sint32x4"
+};
+
+enum GPUVertexStepMode {
+ "vertex",
+ "instance"
+};
+
+dictionary GPUVertexState : GPUProgrammableStage {
+ sequence<GPUVertexBufferLayout?> buffers = [];
+};
+
+dictionary GPUVertexBufferLayout {
+ required GPUSize64 arrayStride;
+ GPUVertexStepMode stepMode = "vertex";
+ required sequence<GPUVertexAttribute> attributes;
+};
+
+dictionary GPUVertexAttribute {
+ required GPUVertexFormat format;
+ required GPUSize64 offset;
+
+ required GPUIndex32 shaderLocation;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUCommandBuffer {
+};
+GPUCommandBuffer includes GPUObjectBase;
+
+dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase {
+};
+
+interface mixin GPUCommandsMixin {
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUCommandEncoder {
+ GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
+ GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {});
+
+ undefined copyBufferToBuffer(
+ GPUBuffer source,
+ GPUSize64 sourceOffset,
+ GPUBuffer destination,
+ GPUSize64 destinationOffset,
+ GPUSize64 size);
+
+ undefined copyBufferToTexture(
+ GPUImageCopyBuffer source,
+ GPUImageCopyTexture destination,
+ GPUExtent3D copySize);
+
+ undefined copyTextureToBuffer(
+ GPUImageCopyTexture source,
+ GPUImageCopyBuffer destination,
+ GPUExtent3D copySize);
+
+ undefined copyTextureToTexture(
+ GPUImageCopyTexture source,
+ GPUImageCopyTexture destination,
+ GPUExtent3D copySize);
+
+ undefined clearBuffer(
+ GPUBuffer buffer,
+ optional GPUSize64 offset = 0,
+ optional GPUSize64 size);
+
+ undefined writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
+
+ undefined resolveQuerySet(
+ GPUQuerySet querySet,
+ GPUSize32 firstQuery,
+ GPUSize32 queryCount,
+ GPUBuffer destination,
+ GPUSize64 destinationOffset);
+
+ GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {});
+};
+GPUCommandEncoder includes GPUObjectBase;
+GPUCommandEncoder includes GPUCommandsMixin;
+GPUCommandEncoder includes GPUDebugCommandsMixin;
+
+dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase {
+};
+
+dictionary GPUImageDataLayout {
+ GPUSize64 offset = 0;
+ GPUSize32 bytesPerRow;
+ GPUSize32 rowsPerImage;
+};
+
+dictionary GPUImageCopyBuffer : GPUImageDataLayout {
+ required GPUBuffer buffer;
+};
+
+dictionary GPUImageCopyTexture {
+ required GPUTexture texture;
+ GPUIntegerCoordinate mipLevel = 0;
+ GPUOrigin3D origin = {};
+ GPUTextureAspect aspect = "all";
+};
+
+dictionary GPUImageCopyTextureTagged : GPUImageCopyTexture {
+ PredefinedColorSpace colorSpace = "srgb";
+ boolean premultipliedAlpha = false;
+};
+
+dictionary GPUImageCopyExternalImage {
+ required (ImageBitmap or HTMLCanvasElement or OffscreenCanvas) source;
+ GPUOrigin2D origin = {};
+ boolean flipY = false;
+};
+
+interface mixin GPUBindingCommandsMixin {
+ undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
+ optional sequence<GPUBufferDynamicOffset> dynamicOffsets = []);
+
+ undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
+ Uint32Array dynamicOffsetsData,
+ GPUSize64 dynamicOffsetsDataStart,
+ GPUSize32 dynamicOffsetsDataLength);
+};
+
+interface mixin GPUDebugCommandsMixin {
+ undefined pushDebugGroup(USVString groupLabel);
+ undefined popDebugGroup();
+ undefined insertDebugMarker(USVString markerLabel);
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUComputePassEncoder {
+ undefined setPipeline(GPUComputePipeline pipeline);
+ undefined dispatchWorkgroups(GPUSize32 workgroupCountX, optional GPUSize32 workgroupCountY = 1, optional GPUSize32 workgroupCountZ = 1);
+ undefined dispatchWorkgroupsIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
+
+ undefined end();
+};
+GPUComputePassEncoder includes GPUObjectBase;
+GPUComputePassEncoder includes GPUCommandsMixin;
+GPUComputePassEncoder includes GPUDebugCommandsMixin;
+GPUComputePassEncoder includes GPUBindingCommandsMixin;
+
+enum GPUComputePassTimestampLocation {
+ "beginning",
+ "end"
+};
+
+dictionary GPUComputePassTimestampWrite {
+ required GPUQuerySet querySet;
+ required GPUSize32 queryIndex;
+ required GPUComputePassTimestampLocation location;
+};
+
+typedef sequence<GPUComputePassTimestampWrite> GPUComputePassTimestampWrites;
+
+dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase {
+ GPUComputePassTimestampWrites timestampWrites = [];
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPURenderPassEncoder {
+ undefined setViewport(float x, float y,
+ float width, float height,
+ float minDepth, float maxDepth);
+
+ undefined setScissorRect(GPUIntegerCoordinate x, GPUIntegerCoordinate y,
+ GPUIntegerCoordinate width, GPUIntegerCoordinate height);
+
+ undefined setBlendConstant(GPUColor color);
+ undefined setStencilReference(GPUStencilValue reference);
+
+ undefined beginOcclusionQuery(GPUSize32 queryIndex);
+ undefined endOcclusionQuery();
+
+ undefined executeBundles(sequence<GPURenderBundle> bundles);
+ undefined end();
+};
+GPURenderPassEncoder includes GPUObjectBase;
+GPURenderPassEncoder includes GPUCommandsMixin;
+GPURenderPassEncoder includes GPUDebugCommandsMixin;
+GPURenderPassEncoder includes GPUBindingCommandsMixin;
+GPURenderPassEncoder includes GPURenderCommandsMixin;
+
+enum GPURenderPassTimestampLocation {
+ "beginning",
+ "end"
+};
+
+dictionary GPURenderPassTimestampWrite {
+ required GPUQuerySet querySet;
+ required GPUSize32 queryIndex;
+ required GPURenderPassTimestampLocation location;
+};
+
+typedef sequence<GPURenderPassTimestampWrite> GPURenderPassTimestampWrites;
+
+dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
+ required sequence<GPURenderPassColorAttachment?> colorAttachments;
+ GPURenderPassDepthStencilAttachment depthStencilAttachment;
+ GPUQuerySet occlusionQuerySet;
+ GPURenderPassTimestampWrites timestampWrites = [];
+ GPUSize64 maxDrawCount = 50000000;
+};
+
+dictionary GPURenderPassColorAttachment {
+ required GPUTextureView view;
+ GPUTextureView resolveTarget;
+
+ GPUColor clearValue;
+ required GPULoadOp loadOp;
+ required GPUStoreOp storeOp;
+};
+
+dictionary GPURenderPassDepthStencilAttachment {
+ required GPUTextureView view;
+
+ float depthClearValue = 0;
+ GPULoadOp depthLoadOp;
+ GPUStoreOp depthStoreOp;
+ boolean depthReadOnly = false;
+
+ GPUStencilValue stencilClearValue = 0;
+ GPULoadOp stencilLoadOp;
+ GPUStoreOp stencilStoreOp;
+ boolean stencilReadOnly = false;
+};
+
+enum GPULoadOp {
+ "load",
+ "clear"
+};
+
+enum GPUStoreOp {
+ "store",
+ "discard"
+};
+
+dictionary GPURenderPassLayout: GPUObjectDescriptorBase {
+ required sequence<GPUTextureFormat?> colorFormats;
+ GPUTextureFormat depthStencilFormat;
+ GPUSize32 sampleCount = 1;
+};
+
+interface mixin GPURenderCommandsMixin {
+ undefined setPipeline(GPURenderPipeline pipeline);
+
+ undefined setIndexBuffer(GPUBuffer buffer, GPUIndexFormat indexFormat, optional GPUSize64 offset = 0, optional GPUSize64 size);
+ undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size);
+
+ undefined draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1,
+ optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
+ undefined drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1,
+ optional GPUSize32 firstIndex = 0,
+ optional GPUSignedOffset32 baseVertex = 0,
+ optional GPUSize32 firstInstance = 0);
+
+ undefined drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
+ undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPURenderBundle {
+};
+GPURenderBundle includes GPUObjectBase;
+
+dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase {
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPURenderBundleEncoder {
+ GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {});
+};
+GPURenderBundleEncoder includes GPUObjectBase;
+GPURenderBundleEncoder includes GPUCommandsMixin;
+GPURenderBundleEncoder includes GPUDebugCommandsMixin;
+GPURenderBundleEncoder includes GPUBindingCommandsMixin;
+GPURenderBundleEncoder includes GPURenderCommandsMixin;
+
+dictionary GPURenderBundleEncoderDescriptor : GPURenderPassLayout {
+ boolean depthReadOnly = false;
+ boolean stencilReadOnly = false;
+};
+
+dictionary GPUQueueDescriptor : GPUObjectDescriptorBase {
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUQueue {
+ undefined submit(sequence<GPUCommandBuffer> commandBuffers);
+
+ Promise<undefined> onSubmittedWorkDone();
+
+ undefined writeBuffer(
+ GPUBuffer buffer,
+ GPUSize64 bufferOffset,
+ [AllowShared] BufferSource data,
+ optional GPUSize64 dataOffset = 0,
+ optional GPUSize64 size);
+
+ undefined writeTexture(
+ GPUImageCopyTexture destination,
+ [AllowShared] BufferSource data,
+ GPUImageDataLayout dataLayout,
+ GPUExtent3D size);
+
+ undefined copyExternalImageToTexture(
+ GPUImageCopyExternalImage source,
+ GPUImageCopyTextureTagged destination,
+ GPUExtent3D copySize);
+};
+GPUQueue includes GPUObjectBase;
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUQuerySet {
+ undefined destroy();
+
+ readonly attribute GPUQueryType type;
+ readonly attribute GPUSize32 count;
+};
+GPUQuerySet includes GPUObjectBase;
+
+dictionary GPUQuerySetDescriptor : GPUObjectDescriptorBase {
+ required GPUQueryType type;
+ required GPUSize32 count;
+};
+
+enum GPUQueryType {
+ "occlusion",
+ "timestamp"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUCanvasContext {
+ readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas;
+
+ undefined configure(GPUCanvasConfiguration configuration);
+ undefined unconfigure();
+
+ GPUTexture getCurrentTexture();
+};
+
+enum GPUCanvasAlphaMode {
+ "opaque",
+ "premultiplied"
+};
+
+dictionary GPUCanvasConfiguration {
+ required GPUDevice device;
+ required GPUTextureFormat format;
+ GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
+ sequence<GPUTextureFormat> viewFormats = [];
+ PredefinedColorSpace colorSpace = "srgb";
+ GPUCanvasAlphaMode alphaMode = "opaque";
+};
+
+enum GPUDeviceLostReason {
+ "destroyed"
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUDeviceLostInfo {
+ readonly attribute (GPUDeviceLostReason or undefined) reason;
+ readonly attribute DOMString message;
+};
+
+partial interface GPUDevice {
+ readonly attribute Promise<GPUDeviceLostInfo> lost;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUError {
+ readonly attribute DOMString message;
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUValidationError : GPUError {
+ constructor(DOMString message);
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUOutOfMemoryError : GPUError {
+ constructor(DOMString message);
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUInternalError : GPUError {
+ constructor(DOMString message);
+};
+
+enum GPUErrorFilter {
+ "validation",
+ "out-of-memory",
+ "internal"
+};
+
+partial interface GPUDevice {
+ undefined pushErrorScope(GPUErrorFilter filter);
+ Promise<GPUError?> popErrorScope();
+};
+
+[Exposed=(Window, DedicatedWorker), SecureContext]
+interface GPUUncapturedErrorEvent : Event {
+ constructor(
+ DOMString type,
+ GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict
+ );
+ [SameObject] readonly attribute GPUError error;
+};
+
+dictionary GPUUncapturedErrorEventInit : EventInit {
+ required GPUError error;
+};
+
+partial interface GPUDevice {
+ [Exposed=(Window, DedicatedWorker)]
+ attribute EventHandler onuncapturederror;
+};
+
+typedef [EnforceRange] unsigned long GPUBufferDynamicOffset;
+typedef [EnforceRange] unsigned long GPUStencilValue;
+typedef [EnforceRange] unsigned long GPUSampleMask;
+typedef [EnforceRange] long GPUDepthBias;
+
+typedef [EnforceRange] unsigned long long GPUSize64;
+typedef [EnforceRange] unsigned long GPUIntegerCoordinate;
+typedef [EnforceRange] unsigned long GPUIndex32;
+typedef [EnforceRange] unsigned long GPUSize32;
+typedef [EnforceRange] long GPUSignedOffset32;
+
+typedef unsigned long GPUFlagsConstant;
+
+dictionary GPUColorDict {
+ required double r;
+ required double g;
+ required double b;
+ required double a;
+};
+typedef (sequence<double> or GPUColorDict) GPUColor;
+
+dictionary GPUOrigin2DDict {
+ GPUIntegerCoordinate x = 0;
+ GPUIntegerCoordinate y = 0;
+};
+typedef (sequence<GPUIntegerCoordinate> or GPUOrigin2DDict) GPUOrigin2D;
+
+dictionary GPUOrigin3DDict {
+ GPUIntegerCoordinate x = 0;
+ GPUIntegerCoordinate y = 0;
+ GPUIntegerCoordinate z = 0;
+};
+typedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D;
+
+dictionary GPUExtent3DDict {
+ required GPUIntegerCoordinate width;
+ GPUIntegerCoordinate height = 1;
+ GPUIntegerCoordinate depthOrArrayLayers = 1;
+};
+typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;
+
diff --git a/vendor/web-sys/webidls/unstable/WebHID.webidl b/vendor/web-sys/webidls/unstable/WebHID.webidl
new file mode 100644
index 000000000..ffc960938
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebHID.webidl
@@ -0,0 +1,127 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content was automatically extracted by Reffy into webref
+// (https://github.com/w3c/webref)
+// Source: WebHID API (https://wicg.github.io/webhid/)
+
+dictionary HIDDeviceFilter {
+ unsigned long vendorId;
+ unsigned short productId;
+ unsigned short usagePage;
+ unsigned short usage;
+};
+
+dictionary HIDDeviceRequestOptions {
+ required sequence<HIDDeviceFilter> filters;
+};
+
+[
+ Exposed=Window,
+ SecureContext
+]
+interface HID : EventTarget {
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+ Promise<sequence<HIDDevice>> getDevices();
+ Promise<sequence<HIDDevice>> requestDevice(
+ HIDDeviceRequestOptions options);
+};
+
+[SecureContext] partial interface Navigator {
+ [SameObject] readonly attribute HID hid;
+};
+
+dictionary HIDConnectionEventInit : EventInit {
+ required HIDDevice device;
+};
+
+[
+ Exposed=Window,
+ SecureContext
+] interface HIDConnectionEvent : Event {
+ constructor(DOMString type, HIDConnectionEventInit eventInitDict);
+ [SameObject] readonly attribute HIDDevice device;
+};
+
+dictionary HIDInputReportEventInit : EventInit {
+ required HIDDevice device;
+ required octet reportId;
+ required DataView data;
+};
+
+[
+ Exposed=Window,
+ SecureContext
+] interface HIDInputReportEvent : Event {
+ constructor(DOMString type, HIDInputReportEventInit eventInitDict);
+ [SameObject] readonly attribute HIDDevice device;
+ readonly attribute octet reportId;
+ readonly attribute DataView data;
+};
+
+enum HIDUnitSystem {
+ "none", "si-linear", "si-rotation", "english-linear",
+ "english-rotation", "vendor-defined", "reserved"
+};
+
+dictionary HIDReportItem {
+ boolean isAbsolute;
+ boolean isArray;
+ boolean isBufferedBytes;
+ boolean isConstant;
+ boolean isLinear;
+ boolean isRange;
+ boolean isVolatile;
+ boolean hasNull;
+ boolean hasPreferredState;
+ boolean wrap;
+ sequence<unsigned long> usages;
+ unsigned long usageMinimum;
+ unsigned long usageMaximum;
+ unsigned short reportSize;
+ unsigned short reportCount;
+ byte unitExponent;
+ HIDUnitSystem unitSystem;
+ byte unitFactorLengthExponent;
+ byte unitFactorMassExponent;
+ byte unitFactorTimeExponent;
+ byte unitFactorTemperatureExponent;
+ byte unitFactorCurrentExponent;
+ byte unitFactorLuminousIntensityExponent;
+ long logicalMinimum;
+ long logicalMaximum;
+ long physicalMinimum;
+ long physicalMaximum;
+ sequence<DOMString> strings;
+};
+
+dictionary HIDReportInfo {
+ octet reportId;
+ sequence<HIDReportItem> items;
+};
+
+dictionary HIDCollectionInfo {
+ unsigned short usagePage;
+ unsigned short usage;
+ octet type;
+ sequence<HIDCollectionInfo> children;
+ sequence<HIDReportInfo> inputReports;
+ sequence<HIDReportInfo> outputReports;
+ sequence<HIDReportInfo> featureReports;
+};
+
+[
+ Exposed=Window,
+ SecureContext
+] interface HIDDevice : EventTarget {
+ attribute EventHandler oninputreport;
+ readonly attribute boolean opened;
+ readonly attribute unsigned short vendorId;
+ readonly attribute unsigned short productId;
+ readonly attribute DOMString productName;
+ readonly attribute FrozenArray<HIDCollectionInfo> collections;
+ Promise<undefined> open();
+ Promise<undefined> close();
+ Promise<undefined> sendReport([EnforceRange] octet reportId, BufferSource data);
+ Promise<undefined> sendFeatureReport([EnforceRange] octet reportId, BufferSource data);
+ Promise<DataView> receiveFeatureReport([EnforceRange] octet reportId);
+};
diff --git a/vendor/web-sys/webidls/unstable/WebSerial.webidl b/vendor/web-sys/webidls/unstable/WebSerial.webidl
new file mode 100644
index 000000000..f2ac7d0b1
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebSerial.webidl
@@ -0,0 +1,80 @@
+[Exposed=Window, SecureContext]
+partial interface Navigator {
+ [SameObject] readonly attribute Serial serial;
+};
+
+[Exposed=DedicatedWorker, SecureContext]
+partial interface WorkerNavigator {
+ [SameObject] readonly attribute Serial serial;
+};
+
+[Exposed=(DedicatedWorker, Window), SecureContext]
+interface Serial : EventTarget {
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+ Promise<sequence<SerialPort>> getPorts();
+ [Exposed=Window] Promise<SerialPort> requestPort(optional SerialPortRequestOptions options = {});
+};
+
+dictionary SerialPortRequestOptions {
+ sequence<SerialPortFilter> filters;
+};
+
+dictionary SerialPortFilter {
+ unsigned short usbVendorId;
+ unsigned short usbProductId;
+};
+
+[Exposed=(DedicatedWorker,Window), SecureContext]
+interface SerialPort : EventTarget {
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+ readonly attribute ReadableStream readable;
+ readonly attribute WritableStream writable;
+
+ SerialPortInfo getInfo();
+
+ Promise<undefined> open(SerialOptions options);
+ Promise<undefined> setSignals(optional SerialOutputSignals signals = {});
+ Promise<SerialInputSignals> getSignals();
+ Promise<undefined> close();
+ Promise<undefined> forget();
+};
+
+dictionary SerialPortInfo {
+ unsigned short usbVendorId;
+ unsigned short usbProductId;
+};
+
+dictionary SerialOptions {
+ [EnforceRange] required unsigned long baudRate;
+ [EnforceRange] octet dataBits = 8;
+ [EnforceRange] octet stopBits = 1;
+ ParityType parity = "none";
+ [EnforceRange] unsigned long bufferSize = 255;
+ FlowControlType flowControl = "none";
+};
+
+enum ParityType {
+ "none",
+ "even",
+ "odd"
+};
+
+enum FlowControlType {
+ "none",
+ "hardware"
+};
+
+dictionary SerialOutputSignals {
+ boolean dataTerminalReady;
+ boolean requestToSend;
+ boolean break;
+};
+
+dictionary SerialInputSignals {
+ required boolean dataCarrierDetect;
+ required boolean clearToSend;
+ required boolean ringIndicator;
+ required boolean dataSetReady;
+};
diff --git a/vendor/web-sys/webidls/unstable/WebUSB.webidl b/vendor/web-sys/webidls/unstable/WebUSB.webidl
new file mode 100644
index 000000000..17b9676fc
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebUSB.webidl
@@ -0,0 +1,243 @@
+dictionary USBDeviceFilter {
+ unsigned short vendorId;
+ unsigned short productId;
+ octet classCode;
+ octet subclassCode;
+ octet protocolCode;
+ DOMString serialNumber;
+};
+
+dictionary USBDeviceRequestOptions {
+ required sequence<USBDeviceFilter> filters;
+};
+
+[Exposed=(DedicatedWorker,SharedWorker,Window), SecureContext]
+interface USB : EventTarget {
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+ Promise<sequence<USBDevice>> getDevices();
+ [Exposed=Window] Promise<USBDevice> requestDevice(USBDeviceRequestOptions options);
+};
+
+[Exposed=Window, SecureContext]
+partial interface Navigator {
+ [SameObject] readonly attribute USB usb;
+};
+
+[Exposed=(DedicatedWorker,SharedWorker), SecureContext]
+partial interface WorkerNavigator {
+ [SameObject] readonly attribute USB usb;
+};
+
+dictionary USBConnectionEventInit : EventInit {
+ required USBDevice device;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBConnectionEvent : Event {
+ constructor(DOMString type, USBConnectionEventInit eventInitDict);
+ [SameObject] readonly attribute USBDevice device;
+};
+
+[Exposed=(DedicatedWorker,SharedWorker,Window), SecureContext]
+interface USBDevice {
+ readonly attribute octet usbVersionMajor;
+ readonly attribute octet usbVersionMinor;
+ readonly attribute octet usbVersionSubminor;
+ readonly attribute octet deviceClass;
+ readonly attribute octet deviceSubclass;
+ readonly attribute octet deviceProtocol;
+ readonly attribute unsigned short vendorId;
+ readonly attribute unsigned short productId;
+ readonly attribute octet deviceVersionMajor;
+ readonly attribute octet deviceVersionMinor;
+ readonly attribute octet deviceVersionSubminor;
+ readonly attribute DOMString? manufacturerName;
+ readonly attribute DOMString? productName;
+ readonly attribute DOMString? serialNumber;
+ readonly attribute USBConfiguration? configuration;
+ readonly attribute FrozenArray<USBConfiguration> configurations;
+ readonly attribute boolean opened;
+ Promise<undefined> open();
+ Promise<undefined> close();
+ Promise<undefined> selectConfiguration(octet configurationValue);
+ Promise<undefined> claimInterface(octet interfaceNumber);
+ Promise<undefined> releaseInterface(octet interfaceNumber);
+ Promise<undefined> selectAlternateInterface(octet interfaceNumber, octet alternateSetting);
+ Promise<USBInTransferResult> controlTransferIn(USBControlTransferParameters setup, unsigned short length);
+ Promise<USBOutTransferResult> controlTransferOut(USBControlTransferParameters setup, optional BufferSource data);
+ Promise<undefined> clearHalt(USBDirection direction, octet endpointNumber);
+ Promise<USBInTransferResult> transferIn(octet endpointNumber, unsigned long length);
+ Promise<USBOutTransferResult> transferOut(octet endpointNumber, BufferSource data);
+ Promise<USBIsochronousInTransferResult> isochronousTransferIn(octet endpointNumber, sequence<unsigned long> packetLengths);
+ Promise<USBIsochronousOutTransferResult> isochronousTransferOut(octet endpointNumber, BufferSource data, sequence<unsigned long> packetLengths);
+ Promise<undefined> reset();
+};
+
+enum USBRequestType {
+ "standard",
+ "class",
+ "vendor"
+};
+
+enum USBRecipient {
+ "device",
+ "interface",
+ "endpoint",
+ "other"
+};
+
+enum USBTransferStatus {
+ "ok",
+ "stall",
+ "babble"
+};
+
+dictionary USBControlTransferParameters {
+ required USBRequestType requestType;
+ required USBRecipient recipient;
+ required octet request;
+ required unsigned short value;
+ required unsigned short index;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBInTransferResult {
+ constructor(USBTransferStatus status, optional DataView? data);
+ readonly attribute DataView? data;
+ readonly attribute USBTransferStatus status;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBOutTransferResult {
+ constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0);
+ readonly attribute unsigned long bytesWritten;
+ readonly attribute USBTransferStatus status;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBIsochronousInTransferPacket {
+ constructor(USBTransferStatus status, optional DataView? data);
+ readonly attribute DataView? data;
+ readonly attribute USBTransferStatus status;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBIsochronousInTransferResult {
+ constructor(sequence<USBIsochronousInTransferPacket> packets, optional DataView? data);
+ readonly attribute DataView? data;
+ readonly attribute FrozenArray<USBIsochronousInTransferPacket> packets;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBIsochronousOutTransferPacket {
+ constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0);
+ readonly attribute unsigned long bytesWritten;
+ readonly attribute USBTransferStatus status;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBIsochronousOutTransferResult {
+ constructor(sequence<USBIsochronousOutTransferPacket> packets);
+ readonly attribute FrozenArray<USBIsochronousOutTransferPacket> packets;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBConfiguration {
+ constructor(USBDevice device, octet configurationValue);
+ readonly attribute octet configurationValue;
+ readonly attribute DOMString? configurationName;
+ readonly attribute FrozenArray<USBInterface> interfaces;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBInterface {
+ constructor(USBConfiguration configuration, octet interfaceNumber);
+ readonly attribute octet interfaceNumber;
+ readonly attribute USBAlternateInterface alternate;
+ readonly attribute FrozenArray<USBAlternateInterface> alternates;
+ readonly attribute boolean claimed;
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBAlternateInterface {
+ constructor(USBInterface deviceInterface, octet alternateSetting);
+ readonly attribute octet alternateSetting;
+ readonly attribute octet interfaceClass;
+ readonly attribute octet interfaceSubclass;
+ readonly attribute octet interfaceProtocol;
+ readonly attribute DOMString? interfaceName;
+ readonly attribute FrozenArray<USBEndpoint> endpoints;
+};
+
+enum USBDirection {
+ "in",
+ "out"
+};
+
+enum USBEndpointType {
+ "bulk",
+ "interrupt",
+ "isochronous"
+};
+
+[
+ Exposed=(DedicatedWorker,SharedWorker,Window),
+ SecureContext
+]
+interface USBEndpoint {
+ constructor(USBAlternateInterface alternate, octet endpointNumber, USBDirection direction);
+ readonly attribute octet endpointNumber;
+ readonly attribute USBDirection direction;
+ readonly attribute USBEndpointType type;
+ readonly attribute unsigned long packetSize;
+};
+
+dictionary USBPermissionDescriptor : PermissionDescriptor {
+ sequence<USBDeviceFilter> filters;
+};
+
+dictionary AllowedUSBDevice {
+ required octet vendorId;
+ required octet productId;
+ DOMString serialNumber;
+};
+
+dictionary USBPermissionStorage {
+ sequence<AllowedUSBDevice> allowedDevices = [];
+};
+
+[Exposed=(DedicatedWorker,SharedWorker,Window)]
+interface USBPermissionResult : PermissionStatus {
+ attribute FrozenArray<USBDevice> devices;
+}; \ No newline at end of file
diff --git a/vendor/web-sys/webidls/unstable/WebXRDevice.webidl b/vendor/web-sys/webidls/unstable/WebXRDevice.webidl
new file mode 100644
index 000000000..e3200ca46
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebXRDevice.webidl
@@ -0,0 +1,297 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * WebXR Device API
+ * W3C Working Draft, 31 March 2022
+ * The origin of this IDL file is:
+ * https://www.w3.org/TR/2022/CR-webxr-20220331/
+ */
+
+partial interface Navigator {
+ [SecureContext, SameObject] readonly attribute XRSystem xr;
+};
+
+[SecureContext, Exposed=Window] interface XRSystem : EventTarget {
+ // Methods
+ Promise<boolean> isSessionSupported(XRSessionMode mode);
+ [NewObject] Promise<XRSession> requestSession(XRSessionMode mode, optional XRSessionInit options = {});
+
+ // Events
+ attribute EventHandler ondevicechange;
+};
+
+enum XRSessionMode {
+ "inline",
+ "immersive-vr",
+ "immersive-ar"
+};
+
+dictionary XRSessionInit {
+ sequence<any> requiredFeatures;
+ sequence<any> optionalFeatures;
+};
+
+enum XRVisibilityState {
+ "visible",
+ "visible-blurred",
+ "hidden",
+};
+
+[SecureContext, Exposed=Window] interface XRSession : EventTarget {
+ // Attributes
+ readonly attribute XRVisibilityState visibilityState;
+ readonly attribute float? frameRate;
+ readonly attribute Float32Array? supportedFrameRates;
+ [SameObject] readonly attribute XRRenderState renderState;
+ [SameObject] readonly attribute XRInputSourceArray inputSources;
+
+ // Methods
+ undefined updateRenderState(optional XRRenderStateInit state = {});
+ Promise<undefined> updateTargetFrameRate(float rate);
+ [NewObject] Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type);
+
+ unsigned long requestAnimationFrame(XRFrameRequestCallback callback);
+ undefined cancelAnimationFrame(unsigned long handle);
+
+ Promise<undefined> end();
+
+ // Events
+ attribute EventHandler onend;
+ attribute EventHandler oninputsourceschange;
+ attribute EventHandler onselect;
+ attribute EventHandler onselectstart;
+ attribute EventHandler onselectend;
+ attribute EventHandler onsqueeze;
+ attribute EventHandler onsqueezestart;
+ attribute EventHandler onsqueezeend;
+ attribute EventHandler onvisibilitychange;
+ attribute EventHandler onframeratechange;
+};
+
+dictionary XRRenderStateInit {
+ double depthNear;
+ double depthFar;
+ double inlineVerticalFieldOfView;
+ XRWebGLLayer? baseLayer;
+ sequence<XRLayer>? layers;
+};
+
+[SecureContext, Exposed=Window] interface XRRenderState {
+ readonly attribute double depthNear;
+ readonly attribute double depthFar;
+ readonly attribute double? inlineVerticalFieldOfView;
+ readonly attribute XRWebGLLayer? baseLayer;
+};
+
+callback XRFrameRequestCallback = undefined (DOMHighResTimeStamp time, XRFrame frame);
+
+[SecureContext, Exposed=Window] interface XRFrame {
+ [SameObject] readonly attribute XRSession session;
+ readonly attribute DOMHighResTimeStamp predictedDisplayTime;
+
+ XRViewerPose? getViewerPose(XRReferenceSpace referenceSpace);
+ XRPose? getPose(XRSpace space, XRSpace baseSpace);
+};
+
+[SecureContext, Exposed=Window] interface XRSpace : EventTarget {
+
+};
+
+enum XRReferenceSpaceType {
+ "viewer",
+ "local",
+ "local-floor",
+ "bounded-floor",
+ "unbounded"
+};
+
+[SecureContext, Exposed=Window]
+interface XRReferenceSpace : XRSpace {
+ [NewObject] XRReferenceSpace getOffsetReferenceSpace(XRRigidTransform originOffset);
+
+ attribute EventHandler onreset;
+};
+
+[SecureContext, Exposed=Window]
+interface XRBoundedReferenceSpace : XRReferenceSpace {
+ readonly attribute FrozenArray<DOMPointReadOnly> boundsGeometry;
+};
+
+enum XREye {
+ "none",
+ "left",
+ "right"
+};
+
+[SecureContext, Exposed=Window] interface XRView {
+ readonly attribute XREye eye;
+ readonly attribute Float32Array projectionMatrix;
+ [SameObject] readonly attribute XRRigidTransform transform;
+ readonly attribute double? recommendedViewportScale;
+
+ undefined requestViewportScale(double? scale);
+};
+
+[SecureContext, Exposed=Window] interface XRViewport {
+ readonly attribute long x;
+ readonly attribute long y;
+ readonly attribute long width;
+ readonly attribute long height;
+};
+
+[SecureContext, Exposed=Window]
+interface XRRigidTransform {
+ constructor(optional DOMPointInit position = {}, optional DOMPointInit orientation = {});
+ [SameObject] readonly attribute DOMPointReadOnly position;
+ [SameObject] readonly attribute DOMPointReadOnly orientation;
+ readonly attribute Float32Array matrix;
+ [SameObject] readonly attribute XRRigidTransform inverse;
+};
+
+[SecureContext, Exposed=Window] interface XRPose {
+ [SameObject] readonly attribute XRRigidTransform transform;
+ [SameObject] readonly attribute DOMPointReadOnly? linearVelocity;
+ [SameObject] readonly attribute DOMPointReadOnly? angularVelocity;
+
+ readonly attribute boolean emulatedPosition;
+};
+
+[SecureContext, Exposed=Window] interface XRViewerPose : XRPose {
+ [SameObject] readonly attribute FrozenArray<XRView> views;
+};
+
+enum XRHandedness {
+ "none",
+ "left",
+ "right"
+};
+
+enum XRTargetRayMode {
+ "gaze",
+ "tracked-pointer",
+ "screen"
+};
+
+[SecureContext, Exposed=Window]
+interface XRInputSource {
+ readonly attribute XRHandedness handedness;
+ readonly attribute XRTargetRayMode targetRayMode;
+ [SameObject] readonly attribute XRSpace targetRaySpace;
+ [SameObject] readonly attribute XRSpace? gripSpace;
+ [SameObject] readonly attribute FrozenArray<DOMString> profiles;
+};
+
+[SecureContext, Exposed=Window]
+interface XRInputSourceArray {
+ iterable<XRInputSource>;
+ readonly attribute unsigned long length;
+ getter XRInputSource(unsigned long index);
+};
+
+[SecureContext, Exposed=Window]
+interface XRLayer : EventTarget {};
+
+
+typedef (WebGLRenderingContext or
+ WebGL2RenderingContext) XRWebGLRenderingContext;
+
+dictionary XRWebGLLayerInit {
+ boolean antialias = true;
+ boolean depth = true;
+ boolean stencil = false;
+ boolean alpha = true;
+ boolean ignoreDepthValues = false;
+ double framebufferScaleFactor = 1.0;
+};
+
+[SecureContext, Exposed=Window]
+interface XRWebGLLayer: XRLayer {
+ constructor(XRSession session,
+ XRWebGLRenderingContext context,
+ optional XRWebGLLayerInit layerInit = {});
+ // Attributes
+ readonly attribute boolean antialias;
+ readonly attribute boolean ignoreDepthValues;
+ attribute float? fixedFoveation;
+
+ [SameObject] readonly attribute WebGLFramebuffer? framebuffer;
+ readonly attribute unsigned long framebufferWidth;
+ readonly attribute unsigned long framebufferHeight;
+
+ // Methods
+ XRViewport? getViewport(XRView view);
+
+ // Static Methods
+ static double getNativeFramebufferScaleFactor(XRSession session);
+};
+
+partial dictionary WebGLContextAttributes {
+ boolean xrCompatible = false;
+};
+
+partial interface mixin WebGLRenderingContextBase {
+ [NewObject] Promise<undefined> makeXRCompatible();
+};
+
+[SecureContext, Exposed=Window]
+interface XRSessionEvent : Event {
+ constructor(DOMString type, XRSessionEventInit eventInitDict);
+ [SameObject] readonly attribute XRSession session;
+};
+
+dictionary XRSessionEventInit : EventInit {
+ required XRSession session;
+};
+
+[SecureContext, Exposed=Window]
+interface XRInputSourceEvent : Event {
+ constructor(DOMString type, XRInputSourceEventInit eventInitDict);
+ [SameObject] readonly attribute XRFrame frame;
+ [SameObject] readonly attribute XRInputSource inputSource;
+};
+
+dictionary XRInputSourceEventInit : EventInit {
+ required XRFrame frame;
+ required XRInputSource inputSource;
+};
+
+[SecureContext, Exposed=Window]
+interface XRInputSourcesChangeEvent : Event {
+ constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict);
+ [SameObject] readonly attribute XRSession session;
+ [SameObject] readonly attribute FrozenArray<XRInputSource> added;
+ [SameObject] readonly attribute FrozenArray<XRInputSource> removed;
+};
+
+dictionary XRInputSourcesChangeEventInit : EventInit {
+ required XRSession session;
+ required FrozenArray<XRInputSource> added;
+ required FrozenArray<XRInputSource> removed;
+
+};
+
+[SecureContext, Exposed=Window]
+interface XRReferenceSpaceEvent : Event {
+ constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict);
+ [SameObject] readonly attribute XRReferenceSpace referenceSpace;
+ [SameObject] readonly attribute XRRigidTransform? transform;
+};
+
+dictionary XRReferenceSpaceEventInit : EventInit {
+ required XRReferenceSpace referenceSpace;
+ XRRigidTransform? transform = null;
+};
+
+dictionary XRSessionSupportedPermissionDescriptor: PermissionDescriptor {
+ XRSessionMode mode;
+};
+
+dictionary XRPermissionDescriptor: PermissionDescriptor {
+ XRSessionMode mode;
+ sequence<any> requiredFeatures;
+ sequence<any> optionalFeatures;
+};
+
+[Exposed=Window]
+interface XRPermissionStatus: PermissionStatus {
+ attribute FrozenArray<any> granted;
+}; \ No newline at end of file
diff --git a/vendor/web-sys/webidls/unstable/WebXRGamepadsModule.webidl b/vendor/web-sys/webidls/unstable/WebXRGamepadsModule.webidl
new file mode 100644
index 000000000..39db79b54
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebXRGamepadsModule.webidl
@@ -0,0 +1,11 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * WebXR Device API
+ * W3C Working Draft, 31 March 2022
+ * The origin of this IDL file is:
+ * https://www.w3.org/TR/2022/WD-webxr-gamepads-module-1-20220426/
+ */
+
+partial interface XRInputSource {
+ [SameObject] readonly attribute Gamepad? gamepad;
+};
diff --git a/vendor/web-sys/webidls/unstable/WebXRHandInputModule.webidl b/vendor/web-sys/webidls/unstable/WebXRHandInputModule.webidl
new file mode 100644
index 000000000..b88323eda
--- /dev/null
+++ b/vendor/web-sys/webidls/unstable/WebXRHandInputModule.webidl
@@ -0,0 +1,69 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * WebXR Device API
+ * W3C Working Draft, 19 April 2022
+ * The origin of this IDL file is:
+ * https://www.w3.org/TR/2022/WD-webxr-hand-input-1-20220419/
+ */
+
+partial interface XRInputSource {
+ [SameObject] readonly attribute XRHand? hand;
+};
+
+enum XRHandJoint {
+ "wrist",
+
+ "thumb-metacarpal",
+ "thumb-phalanx-proximal",
+ "thumb-phalanx-distal",
+ "thumb-tip",
+
+ "index-finger-metacarpal",
+ "index-finger-phalanx-proximal",
+ "index-finger-phalanx-intermediate",
+ "index-finger-phalanx-distal",
+ "index-finger-tip",
+
+ "middle-finger-metacarpal",
+ "middle-finger-phalanx-proximal",
+ "middle-finger-phalanx-intermediate",
+ "middle-finger-phalanx-distal",
+ "middle-finger-tip",
+
+ "ring-finger-metacarpal",
+ "ring-finger-phalanx-proximal",
+ "ring-finger-phalanx-intermediate",
+ "ring-finger-phalanx-distal",
+ "ring-finger-tip",
+
+ "pinky-finger-metacarpal",
+ "pinky-finger-phalanx-proximal",
+ "pinky-finger-phalanx-intermediate",
+ "pinky-finger-phalanx-distal",
+ "pinky-finger-tip"
+};
+
+[Exposed=Window]
+interface XRHand {
+ iterable<XRHandJoint, XRJointSpace>;
+
+ readonly attribute unsigned long size;
+ XRJointSpace get(XRHandJoint key);
+};
+
+[Exposed=Window]
+interface XRJointSpace: XRSpace {
+ readonly attribute XRHandJoint jointName;
+};
+
+partial interface XRFrame {
+ XRJointPose? getJointPose(XRJointSpace joint, XRSpace baseSpace);
+ boolean fillJointRadii(sequence<XRJointSpace> jointSpaces, Float32Array radii);
+
+ boolean fillPoses(sequence<XRSpace> spaces, XRSpace baseSpace, Float32Array transforms);
+};
+
+[Exposed=Window]
+interface XRJointPose: XRPose {
+ readonly attribute float radius;
+};