From 05a7902559cddf61042545e8391e3c030e6b14c1 Mon Sep 17 00:00:00 2001 From: wpt-pr-bot Date: Thu, 3 Jun 2021 12:50:08 +0000 Subject: [PATCH] Sync interfaces/ with @webref/idl 2.2.1 --- interfaces/performance-measure-memory.idl | 2 +- interfaces/visual-viewport.idl | 2 + interfaces/webcodecs.idl | 115 +++++++++++++--------- interfaces/{gpuweb.idl => webgpu.idl} | 7 +- interfaces/webtransport.idl | 7 +- 5 files changed, 77 insertions(+), 56 deletions(-) rename interfaces/{gpuweb.idl => webgpu.idl} (99%) diff --git a/interfaces/performance-measure-memory.idl b/interfaces/performance-measure-memory.idl index 5983a6ab8dccadb..b60f2b688cc4daf 100644 --- a/interfaces/performance-measure-memory.idl +++ b/interfaces/performance-measure-memory.idl @@ -26,5 +26,5 @@ dictionary MemoryAttributionContainer { }; partial interface Performance { - [CrossOriginIsolated] Promise measureUserAgentSpecificMemory(); + [Exposed=(Window,ServiceWorker,SharedWorker), CrossOriginIsolated] Promise measureUserAgentSpecificMemory(); }; diff --git a/interfaces/visual-viewport.idl b/interfaces/visual-viewport.idl index c66e85bdcc1f9fc..516f8bd97e5c97d 100644 --- a/interfaces/visual-viewport.idl +++ b/interfaces/visual-viewport.idl @@ -20,6 +20,8 @@ interface VisualViewport : EventTarget { readonly attribute double scale; + readonly attribute FrozenArray segments; + attribute EventHandler onresize; attribute EventHandler onscroll; }; diff --git a/interfaces/webcodecs.idl b/interfaces/webcodecs.idl index 1203ebae3efe15f..08f9f7a345af409 100644 --- a/interfaces/webcodecs.idl +++ b/interfaces/webcodecs.idl @@ -70,7 +70,13 @@ dictionary AudioEncoderInit { required WebCodecsErrorCallback error; }; -callback EncodedAudioChunkOutputCallback = undefined(EncodedAudioChunk output); +callback EncodedAudioChunkOutputCallback = + undefined (EncodedAudioChunk output, + optional EncodedAudioChunkMetadata metadata = {}); + +dictionary EncodedAudioChunkMetadata { + AudioDecoderConfig decoderConfig; +}; [Exposed=(Window,DedicatedWorker)] interface VideoEncoder { @@ -93,7 +99,14 @@ dictionary VideoEncoderInit { required WebCodecsErrorCallback error; }; -callback EncodedVideoChunkOutputCallback = undefined(EncodedVideoChunk output, VideoDecoderConfig? output_config); +callback EncodedVideoChunkOutputCallback = + undefined (EncodedVideoChunk chunk, + optional EncodedVideoChunkMetadata metadata = {}); + +dictionary EncodedVideoChunkMetadata { + VideoDecoderConfig decoderConfig; + unsigned long temporalLayerId; +}; dictionary AudioDecoderSupport { boolean supported; @@ -117,40 +130,37 @@ dictionary VideoEncoderSupport { dictionary AudioDecoderConfig { required DOMString codec; - required unsigned long sampleRate; - required unsigned long numberOfChannels; + [EnforceRange] required unsigned long sampleRate; + [EnforceRange] required unsigned long numberOfChannels; BufferSource description; }; dictionary VideoDecoderConfig { required DOMString codec; BufferSource description; - unsigned long codedWidth; - unsigned long codedHeight; - unsigned long cropLeft; - unsigned long cropTop; - unsigned long cropWidth; - unsigned long cropHeight; - unsigned long displayWidth; - unsigned long displayHeight; + [EnforceRange] unsigned long codedWidth; + [EnforceRange] unsigned long codedHeight; + [EnforceRange] unsigned long displayAspectWidth; + [EnforceRange] unsigned long displayAspectHeight; HardwareAcceleration hardwareAcceleration = "allow"; }; dictionary AudioEncoderConfig { required DOMString codec; - unsigned long sampleRate; - unsigned long numberOfChannels; - unsigned long long bitrate; + [EnforceRange] unsigned long sampleRate; + [EnforceRange] unsigned long numberOfChannels; + [EnforceRange] unsigned long long bitrate; }; dictionary VideoEncoderConfig { required DOMString codec; - unsigned long long bitrate; - required unsigned long width; - required unsigned long height; - unsigned long displayWidth; - unsigned long displayHeight; + [EnforceRange] unsigned long long bitrate; + [EnforceRange] required unsigned long width; + [EnforceRange] required unsigned long height; + [EnforceRange] unsigned long displayWidth; + [EnforceRange] unsigned long displayHeight; HardwareAcceleration hardwareAcceleration = "allow"; + DOMString scalabilityMode; }; enum HardwareAcceleration { @@ -183,7 +193,7 @@ interface EncodedAudioChunk { dictionary EncodedAudioChunkInit { required EncodedAudioChunkType type; - required long long timestamp; // microseconds + [EnforceRange] required long long timestamp; // microseconds required BufferSource data; }; @@ -205,8 +215,8 @@ interface EncodedVideoChunk { dictionary EncodedVideoChunkInit { required EncodedVideoChunkType type; - required long long timestamp; // microseconds - long long duration; // microseconds + [EnforceRange] required long long timestamp; // microseconds + [EnforceRange] long long duration; // microseconds required BufferSource data; }; @@ -223,30 +233,39 @@ interface AudioData { readonly attribute float sampleRate; readonly attribute unsigned long numberOfFrames; readonly attribute unsigned long numberOfChannels; - readonly attribute unsigned long allocationSize; readonly attribute long long duration; // microseconds readonly attribute long long timestamp; // microseconds - undefined copyTo([AllowShared] BufferSource destination, unsigned long planeNumber); + unsigned long allocationSize(AudioDataCopyToOptions options); + undefined copyTo([AllowShared] BufferSource destination, AudioDataCopyToOptions options); AudioData clone(); undefined close(); }; dictionary AudioDataInit { required AudioSampleFormat sampleFormat; - required float sampleRate; - required unsigned long numberOfFrames; - required unsigned long numberOfChannels; - required long long timestamp; // microseconds + [EnforceRange] required float sampleRate; + [EnforceRange] required unsigned long numberOfFrames; + [EnforceRange] required unsigned long numberOfChannels; + [EnforceRange] required long long timestamp; // microseconds required BufferSource data; }; +dictionary AudioDataCopyToOptions { + required unsigned long planeIndex; + unsigned long frameOffset = 0; + unsigned long frameCount; +}; + enum AudioSampleFormat { "U8", "S16", + "S24", "S32", "FLT", + "U8P", "S16P", + "S24P", "S32P", "FLTP", }; @@ -281,16 +300,16 @@ dictionary VideoFrameInit { dictionary VideoFramePlaneInit { required PixelFormat format; - required unsigned long codedWidth; - required unsigned long codedHeight; - unsigned long cropLeft; - unsigned long cropTop; - unsigned long cropWidth; - unsigned long cropHeight; - unsigned long displayWidth; - unsigned long displayHeight; - long long duration; // microseconds - long long timestamp; // microseconds + [EnforceRange] required unsigned long codedWidth; + [EnforceRange] required unsigned long codedHeight; + [EnforceRange] unsigned long cropLeft; + [EnforceRange] unsigned long cropTop; + [EnforceRange] unsigned long cropWidth; + [EnforceRange] unsigned long cropHeight; + [EnforceRange] unsigned long displayWidth; + [EnforceRange] unsigned long displayHeight; + [EnforceRange] long long duration; // microseconds + [EnforceRange] long long timestamp; // microseconds }; [Exposed=(Window,DedicatedWorker)] @@ -304,8 +323,8 @@ interface Plane { dictionary PlaneInit { required BufferSource src; - required unsigned long stride; - required unsigned long rows; + [EnforceRange] required unsigned long stride; + [EnforceRange] required unsigned long rows; }; enum PixelFormat { @@ -333,13 +352,13 @@ dictionary ImageDecoderInit { required ImageBufferSource data; PremultiplyAlpha premultiplyAlpha = "default"; ColorSpaceConversion colorSpaceConversion = "default"; - unsigned long desiredWidth; - unsigned long desiredHeight; + [EnforceRange] unsigned long desiredWidth; + [EnforceRange] unsigned long desiredHeight; boolean preferAnimation; }; dictionary ImageDecodeOptions { - unsigned long frameIndex = 0; + [EnforceRange] unsigned long frameIndex = 0; boolean completeFramesOnly = true; }; @@ -353,16 +372,16 @@ interface ImageTrackList { getter ImageTrack (unsigned long index); readonly attribute Promise ready; - readonly attribute unsigned long length; - readonly attribute long selectedIndex; + [EnforceRange] readonly attribute unsigned long length; + [EnforceRange] 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; + [EnforceRange] readonly attribute unsigned long frameCount; + [EnforceRange] readonly attribute unrestricted float repetitionCount; attribute EventHandler onchange; attribute boolean selected; }; diff --git a/interfaces/gpuweb.idl b/interfaces/webgpu.idl similarity index 99% rename from interfaces/gpuweb.idl rename to interfaces/webgpu.idl index 3f7111820a726ad..71b651baea0dbaf 100644 --- a/interfaces/gpuweb.idl +++ b/interfaces/webgpu.idl @@ -12,7 +12,7 @@ dictionary GPUObjectDescriptorBase { }; [Exposed=Window] -interface GPUAdapterLimits { +interface GPUSupportedLimits { readonly attribute unsigned long maxTextureDimension1D; readonly attribute unsigned long maxTextureDimension2D; readonly attribute unsigned long maxTextureDimension3D; @@ -65,7 +65,7 @@ enum GPUPowerPreference { interface GPUAdapter { readonly attribute DOMString name; [SameObject] readonly attribute GPUSupportedFeatures features; - [SameObject] readonly attribute GPUAdapterLimits limits; + [SameObject] readonly attribute GPUSupportedLimits limits; Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); }; @@ -87,7 +87,7 @@ enum GPUFeatureName { [Exposed=(Window, DedicatedWorker), Serializable] interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; - readonly attribute object limits; + [SameObject] readonly attribute GPUSupportedLimits limits; [SameObject] readonly attribute GPUQueue queue; @@ -994,6 +994,7 @@ dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase { required GPUTextureFormat format; GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque"; + GPUExtent3D size; }; [Exposed=Window] diff --git a/interfaces/webtransport.idl b/interfaces/webtransport.idl index 6c3df2abc52cc97..4862befd5b86e36 100644 --- a/interfaces/webtransport.idl +++ b/interfaces/webtransport.idl @@ -70,8 +70,8 @@ dictionary WebTransportStats { [ Exposed=(Window,Worker) ] interface SendStream : WritableStream /* of Uint8Array */ { - readonly attribute Promise writingAborted; - undefined abortWriting(optional StreamAbortInfo abortInfo = {}); + readonly attribute Promise remoteCanceled; + undefined reset(optional StreamAbortInfo abortInfo = {}); }; dictionary StreamAbortInfo { @@ -80,8 +80,7 @@ dictionary StreamAbortInfo { [ Exposed=(Window,Worker) ] interface ReceiveStream : ReadableStream /* of Uint8Array */ { - readonly attribute Promise readingAborted; - undefined abortReading(optional StreamAbortInfo abortInfo = {}); + readonly attribute Promise remoteReset; }; [ Exposed=(Window,Worker) ]