Skip to content

Commit

Permalink
Sync interfaces/ with @webref/idl 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wpt-pr-bot authored Jun 3, 2021
1 parent 0895a4d commit 05a7902
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 56 deletions.
2 changes: 1 addition & 1 deletion interfaces/performance-measure-memory.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dictionary MemoryAttributionContainer {
};

partial interface Performance {
[CrossOriginIsolated] Promise<MemoryMeasurement> measureUserAgentSpecificMemory();
[Exposed=(Window,ServiceWorker,SharedWorker), CrossOriginIsolated] Promise<MemoryMeasurement> measureUserAgentSpecificMemory();
};
2 changes: 2 additions & 0 deletions interfaces/visual-viewport.idl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface VisualViewport : EventTarget {

readonly attribute double scale;

readonly attribute FrozenArray<DOMRect> segments;

attribute EventHandler onresize;
attribute EventHandler onscroll;
};
115 changes: 67 additions & 48 deletions interfaces/webcodecs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
};

Expand All @@ -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;
};

Expand All @@ -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",
};
Expand Down Expand Up @@ -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)]
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
};

Expand All @@ -353,16 +372,16 @@ interface ImageTrackList {
getter ImageTrack (unsigned long index);

readonly attribute Promise<undefined> 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;
};
7 changes: 4 additions & 3 deletions interfaces/gpuweb.idl → interfaces/webgpu.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
};
Expand All @@ -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;

Expand Down Expand Up @@ -994,6 +994,7 @@ dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase {
required GPUTextureFormat format;
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque";
GPUExtent3D size;
};

[Exposed=Window]
Expand Down
7 changes: 3 additions & 4 deletions interfaces/webtransport.idl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ dictionary WebTransportStats {

[ Exposed=(Window,Worker) ]
interface SendStream : WritableStream /* of Uint8Array */ {
readonly attribute Promise<StreamAbortInfo> writingAborted;
undefined abortWriting(optional StreamAbortInfo abortInfo = {});
readonly attribute Promise<StreamAbortInfo> remoteCanceled;
undefined reset(optional StreamAbortInfo abortInfo = {});
};

dictionary StreamAbortInfo {
Expand All @@ -80,8 +80,7 @@ dictionary StreamAbortInfo {

[ Exposed=(Window,Worker) ]
interface ReceiveStream : ReadableStream /* of Uint8Array */ {
readonly attribute Promise<StreamAbortInfo> readingAborted;
undefined abortReading(optional StreamAbortInfo abortInfo = {});
readonly attribute Promise<StreamAbortInfo> remoteReset;
};

[ Exposed=(Window,Worker) ]
Expand Down

0 comments on commit 05a7902

Please sign in to comment.