From c9af3234ce3eafa9d3cbe39addcacae4a36bb760 Mon Sep 17 00:00:00 2001 From: wpt-pr-bot Date: Thu, 15 Jul 2021 12:25:38 +0000 Subject: [PATCH] Sync interfaces/ with @webref/idl 2.2.8 --- interfaces/CSP.idl | 21 +- interfaces/WebIDL.idl | 1 + interfaces/construct-stylesheets.idl | 13 - interfaces/css-typed-om.idl | 8 +- interfaces/cssom.idl | 11 + interfaces/device-posture.idl | 9 +- interfaces/encrypted-media.idl | 20 +- interfaces/file-system-access.idl | 16 + interfaces/html.idl | 94 ++--- interfaces/js-self-profiling.idl | 8 +- interfaces/local-font-access.idl | 6 + interfaces/mathml-core.idl | 2 +- interfaces/media-source.idl | 1 + interfaces/payment-handler.idl | 2 - interfaces/performance-measure-memory.idl | 2 +- interfaces/permissions.idl | 3 +- interfaces/pointerlock.idl | 8 +- interfaces/resource-timing.idl | 36 +- interfaces/sanitizer-api.idl | 13 +- interfaces/screen-capture.idl | 9 + interfaces/scroll-animations.idl | 3 - interfaces/streams.idl | 2 + interfaces/uuid.idl | 9 + interfaces/visual-viewport.idl | 2 + interfaces/web-animations-2.idl | 7 +- interfaces/web-animations.idl | 4 - interfaces/webcodecs.idl | 184 +++++---- interfaces/{gpuweb.idl => webgpu.idl} | 133 ++++--- interfaces/webhid.idl | 115 +++--- interfaces/webnn.idl | 448 ++++++++++++++++++++++ interfaces/webrtc-encoded-transform.idl | 22 ++ interfaces/webtransport.idl | 43 +-- 32 files changed, 899 insertions(+), 356 deletions(-) create mode 100644 interfaces/uuid.idl rename interfaces/{gpuweb.idl => webgpu.idl} (90%) create mode 100644 interfaces/webnn.idl diff --git a/interfaces/CSP.idl b/interfaces/CSP.idl index fd08a33499b19ea..1e69b3cb53b4453 100644 --- a/interfaces/CSP.idl +++ b/interfaces/CSP.idl @@ -25,11 +25,9 @@ enum SecurityPolicyViolationEventDisposition { [Exposed=(Window,Worker)] interface SecurityPolicyViolationEvent : Event { constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict = {}); - readonly attribute USVString documentURL; - readonly attribute USVString documentURI; // historical alias of documentURL + readonly attribute USVString documentURI; readonly attribute USVString referrer; - readonly attribute USVString blockedURL; - readonly attribute USVString blockedURI; // historical alias of blockedURL + readonly attribute USVString blockedURI; readonly attribute DOMString effectiveDirective; readonly attribute DOMString violatedDirective; // historical alias of effectiveDirective readonly attribute DOMString originalPolicy; @@ -37,22 +35,21 @@ interface SecurityPolicyViolationEvent : Event { readonly attribute DOMString sample; readonly attribute SecurityPolicyViolationEventDisposition disposition; readonly attribute unsigned short statusCode; - readonly attribute unsigned long lineno; - readonly attribute unsigned long lineNumber; // historical alias of lineno - readonly attribute unsigned long colno; - readonly attribute unsigned long columnNumber; // historical alias of colno + readonly attribute unsigned long lineNumber; + readonly attribute unsigned long columnNumber; }; dictionary SecurityPolicyViolationEventInit : EventInit { - required USVString documentURL; + required USVString documentURI; USVString referrer = ""; - USVString blockedURL = ""; + USVString blockedURI = ""; + required DOMString violatedDirective; required DOMString effectiveDirective; required DOMString originalPolicy; USVString sourceFile = ""; DOMString sample = ""; required SecurityPolicyViolationEventDisposition disposition; required unsigned short statusCode; - unsigned long lineno = 0; - unsigned long colno = 0; + unsigned long lineNumber = 0; + unsigned long columnNumber = 0; }; diff --git a/interfaces/WebIDL.idl b/interfaces/WebIDL.idl index 5179d167038524b..546eb2b7b4a3147 100644 --- a/interfaces/WebIDL.idl +++ b/interfaces/WebIDL.idl @@ -5,6 +5,7 @@ typedef (Int8Array or Int16Array or Int32Array or Uint8Array or Uint16Array or Uint32Array or Uint8ClampedArray or + BigInt64Array or BigUint64Array or Float32Array or Float64Array or DataView) ArrayBufferView; typedef (ArrayBufferView or ArrayBuffer) BufferSource; diff --git a/interfaces/construct-stylesheets.idl b/interfaces/construct-stylesheets.idl index 249af039302648d..8906c8f34a791f5 100644 --- a/interfaces/construct-stylesheets.idl +++ b/interfaces/construct-stylesheets.idl @@ -3,19 +3,6 @@ // (https://github.com/w3c/webref) // Source: Constructable Stylesheet Objects (https://wicg.github.io/construct-stylesheets/) -partial interface CSSStyleSheet { - constructor(optional CSSStyleSheetInit options = {}); - Promise replace(USVString text); - undefined replaceSync(USVString text); -}; - -dictionary CSSStyleSheetInit { - (MediaList or DOMString) media = ""; - DOMString title = ""; - boolean alternate = false; - boolean disabled = false; -}; - partial interface mixin DocumentOrShadowRoot { attribute FrozenArray adoptedStyleSheets; }; diff --git a/interfaces/css-typed-om.idl b/interfaces/css-typed-om.idl index 262d2884e8379aa..4b27ce05e4fb3cc 100644 --- a/interfaces/css-typed-om.idl +++ b/interfaces/css-typed-om.idl @@ -158,10 +158,10 @@ interface CSSMathMax : CSSMathValue { [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] interface CSSMathClamp : CSSMathValue { - constructor(CSSNumberish min, CSSNumberish val, CSSNumberish max); - readonly attribute CSSNumericValue min; - readonly attribute CSSNumericValue val; - readonly attribute CSSNumericValue max; + constructor(CSSNumberish lower, CSSNumberish value, CSSNumberish upper); + readonly attribute CSSNumericValue lower; + readonly attribute CSSNumericValue value; + readonly attribute CSSNumericValue upper; }; [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] diff --git a/interfaces/cssom.idl b/interfaces/cssom.idl index c8e0bbb5aab9495..baec2849388d00b 100644 --- a/interfaces/cssom.idl +++ b/interfaces/cssom.idl @@ -33,10 +33,21 @@ interface StyleSheet { [Exposed=Window] interface CSSStyleSheet : StyleSheet { + constructor(optional CSSStyleSheetInit options = {}); + readonly attribute CSSRule? ownerRule; [SameObject] readonly attribute CSSRuleList cssRules; unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0); undefined deleteRule(unsigned long index); + + Promise replace(USVString text); + undefined replaceSync(USVString text); +}; + +dictionary CSSStyleSheetInit { + DOMString baseURL = null; + (MediaList or DOMString) media = ""; + boolean disabled = false; }; partial interface CSSStyleSheet { diff --git a/interfaces/device-posture.idl b/interfaces/device-posture.idl index 5f3574db98fa09d..ba8f9f51f025d9a 100644 --- a/interfaces/device-posture.idl +++ b/interfaces/device-posture.idl @@ -15,10 +15,7 @@ interface DevicePosture : EventTarget { }; enum DevicePostureType { - "no-fold", - "laptop", - "flat", - "tent", - "tablet", - "book" + "continuous", + "folded", + "folded-over" }; diff --git a/interfaces/encrypted-media.idl b/interfaces/encrypted-media.idl index ba8c32d05c467ec..24db48ecf9c3ca2 100644 --- a/interfaces/encrypted-media.idl +++ b/interfaces/encrypted-media.idl @@ -46,13 +46,21 @@ enum MediaKeySessionType { Promise setServerCertificate (BufferSource serverCertificate); }; +enum MediaKeySessionClosedReason { + "internal-error", + "closed-by-application", + "release-acknowledged", + "hardware-context-reset", + "resource-evicted" +}; + [Exposed=Window, SecureContext] interface MediaKeySession : EventTarget { - readonly attribute DOMString sessionId; - readonly attribute unrestricted double expiration; - readonly attribute Promise closed; - readonly attribute MediaKeyStatusMap keyStatuses; - attribute EventHandler onkeystatuseschange; - attribute EventHandler onmessage; + readonly attribute DOMString sessionId; + readonly attribute unrestricted double expiration; + readonly attribute Promise closed; + readonly attribute MediaKeyStatusMap keyStatuses; + attribute EventHandler onkeystatuseschange; + attribute EventHandler onmessage; Promise generateRequest (DOMString initDataType, BufferSource initData); Promise load (DOMString sessionId); Promise update (BufferSource response); diff --git a/interfaces/file-system-access.idl b/interfaces/file-system-access.idl index 3eda19c9d84af81..252e9cdc5987843 100644 --- a/interfaces/file-system-access.idl +++ b/interfaces/file-system-access.idl @@ -89,6 +89,17 @@ interface FileSystemWritableFileStream : WritableStream { Promise truncate(unsigned long long size); }; +enum WellKnownDirectory { + "desktop", + "documents", + "downloads", + "music", + "pictures", + "videos", +}; + +typedef (WellKnownDirectory or FileSystemHandle) StartInDirectory; + dictionary FilePickerAcceptType { USVString description; record)> accept; @@ -97,6 +108,8 @@ dictionary FilePickerAcceptType { dictionary FilePickerOptions { sequence types; boolean excludeAcceptAllOption = false; + DOMString id; + StartInDirectory startIn; }; dictionary OpenFilePickerOptions : FilePickerOptions { @@ -104,9 +117,12 @@ dictionary OpenFilePickerOptions : FilePickerOptions { }; dictionary SaveFilePickerOptions : FilePickerOptions { + USVString? suggestedName; }; dictionary DirectoryPickerOptions { + DOMString id; + StartInDirectory startIn; }; [SecureContext] diff --git a/interfaces/html.idl b/interfaces/html.idl index d878cba3367cc62..c523c7b88fcd9f3 100644 --- a/interfaces/html.idl +++ b/interfaces/html.idl @@ -210,6 +210,7 @@ interface HTMLMetaElement : HTMLElement { [CEReactions] attribute DOMString name; [CEReactions] attribute DOMString httpEquiv; [CEReactions] attribute DOMString content; + [CEReactions] attribute DOMString media; // also has obsolete members }; @@ -972,7 +973,7 @@ interface HTMLSelectElement : HTMLElement { [SameObject] readonly attribute HTMLOptionsCollection options; [CEReactions] attribute unsigned long length; - getter Element? item(unsigned long index); + getter HTMLOptionElement? item(unsigned long index); HTMLOptionElement? namedItem(DOMString name); [CEReactions] undefined add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null); [CEReactions] undefined remove(); // ChildNode overload @@ -1239,7 +1240,7 @@ dictionary AssignedNodesOptions { boolean flatten = false; }; -typedef (CanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext) RenderingContext; +typedef (CanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext or GPUCanvasContext) RenderingContext; [Exposed=Window] interface HTMLCanvasElement : HTMLElement { @@ -1274,6 +1275,7 @@ dictionary CanvasRenderingContext2DSettings { boolean alpha = true; boolean desynchronized = false; PredefinedColorSpace colorSpace = "srgb"; + boolean willReadFrequently = false; }; enum ImageSmoothingQuality { "low", "medium", "high" }; @@ -1458,6 +1460,7 @@ interface mixin CanvasPath { undefined bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y); undefined arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius); undefined rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); + undefined roundRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, sequence<(unrestricted double or DOMPointInit)> radii); undefined arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean counterclockwise = false); undefined ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean counterclockwise = false); }; @@ -1527,14 +1530,14 @@ dictionary ImageBitmapRenderingContextSettings { boolean alpha = true; }; -typedef (OffscreenCanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext) OffscreenRenderingContext; +typedef (OffscreenCanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext or GPUCanvasContext) OffscreenRenderingContext; dictionary ImageEncodeOptions { DOMString type = "image/png"; unrestricted double quality; }; -enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2" }; +enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2", "webgpu" }; [Exposed=(Window,Worker), Transferable] interface OffscreenCanvas : EventTarget { @@ -1724,6 +1727,7 @@ interface Window : EventTarget { // the user agent readonly attribute Navigator navigator; + readonly attribute Navigator clientInformation; // legacy alias of .navigator readonly attribute boolean originAgentCluster; // user prompts @@ -2050,6 +2054,49 @@ interface mixin NavigatorCookies { readonly attribute boolean cookieEnabled; }; +interface mixin NavigatorPlugins { + [SameObject] readonly attribute PluginArray plugins; + [SameObject] readonly attribute MimeTypeArray mimeTypes; + boolean javaEnabled(); + readonly attribute boolean pdfViewerEnabled; +}; + +[Exposed=Window, + LegacyUnenumerableNamedProperties] +interface PluginArray { + undefined refresh(); + readonly attribute unsigned long length; + getter Plugin? item(unsigned long index); + getter Plugin? namedItem(DOMString name); +}; + +[Exposed=Window, + LegacyUnenumerableNamedProperties] +interface MimeTypeArray { + readonly attribute unsigned long length; + getter MimeType? item(unsigned long index); + getter MimeType? namedItem(DOMString name); +}; + +[Exposed=Window, + LegacyUnenumerableNamedProperties] +interface Plugin { + readonly attribute DOMString name; + readonly attribute DOMString description; + readonly attribute DOMString filename; + readonly attribute unsigned long length; + getter MimeType? item(unsigned long index); + getter MimeType? namedItem(DOMString name); +}; + +[Exposed=Window] +interface MimeType { + readonly attribute DOMString type; + readonly attribute DOMString description; + readonly attribute DOMString suffixes; + readonly attribute Plugin enabledPlugin; +}; + [Exposed=(Window,Worker), Serializable, Transferable] interface ImageBitmap { readonly attribute unsigned long width; @@ -2656,42 +2703,3 @@ interface External { undefined AddSearchProvider(); undefined IsSearchProviderInstalled(); }; - -interface mixin NavigatorPlugins { - [SameObject] readonly attribute PluginArray plugins; - [SameObject] readonly attribute MimeTypeArray mimeTypes; - boolean javaEnabled(); -}; - -[Exposed=Window] -interface PluginArray { - undefined refresh(); - readonly attribute unsigned long length; - getter object? item(unsigned long index); - object? namedItem(DOMString name); -}; - -[Exposed=Window] -interface MimeTypeArray { - readonly attribute unsigned long length; - getter object? item(unsigned long index); - object? namedItem(DOMString name); -}; - -[Exposed=Window] -interface Plugin { - readonly attribute undefined name; - readonly attribute undefined description; - readonly attribute undefined filename; - readonly attribute undefined length; - getter undefined item(unsigned long index); - undefined namedItem(DOMString name); -}; - -[Exposed=Window] -interface MimeType { - readonly attribute undefined type; - readonly attribute undefined description; - readonly attribute undefined suffixes; - readonly attribute undefined enabledPlugin; -}; diff --git a/interfaces/js-self-profiling.idl b/interfaces/js-self-profiling.idl index a2199999eada84f..d16aeda37a3449e 100644 --- a/interfaces/js-self-profiling.idl +++ b/interfaces/js-self-profiling.idl @@ -3,11 +3,12 @@ // (https://github.com/w3c/webref) // Source: JS Self-Profiling API (https://wicg.github.io/js-self-profiling/) -[Exposed=(Window,Worker)] +[Exposed=Window] interface Profiler : EventTarget { readonly attribute DOMHighResTimeStamp sampleInterval; readonly attribute boolean stopped; + constructor(ProfilerInitOptions options); Promise stop(); }; @@ -41,8 +42,3 @@ dictionary ProfilerInitOptions { required DOMHighResTimeStamp sampleInterval; required unsigned long maxBufferSize; }; - -[Exposed=(Window,Worker)] -partial interface Performance { - Promise profile(ProfilerInitOptions options); -}; diff --git a/interfaces/local-font-access.idl b/interfaces/local-font-access.idl index d7fb3c91f3d9a61..577cd3621ac327c 100644 --- a/interfaces/local-font-access.idl +++ b/interfaces/local-font-access.idl @@ -25,8 +25,14 @@ dictionary QueryOptions { interface FontMetadata { Promise blob(); + // Names readonly attribute USVString postscriptName; readonly attribute USVString fullName; readonly attribute USVString family; readonly attribute USVString style; + + // Metrics + readonly attribute boolean italic; + readonly attribute float stretch; + readonly attribute float weight; }; diff --git a/interfaces/mathml-core.idl b/interfaces/mathml-core.idl index 7ea134625ff431b..3989288b3bd14de 100644 --- a/interfaces/mathml-core.idl +++ b/interfaces/mathml-core.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: MathML Core (https://mathml-refresh.github.io/mathml-core/) +// Source: MathML Core (https://w3c.github.io/mathml-core/) [Exposed=Window] interface MathMLElement : Element { }; diff --git a/interfaces/media-source.idl b/interfaces/media-source.idl index ba57b131082f09b..054af82d25e8619 100644 --- a/interfaces/media-source.idl +++ b/interfaces/media-source.idl @@ -55,6 +55,7 @@ interface SourceBuffer : EventTarget { attribute EventHandler onabort; undefined appendBuffer (BufferSource data); undefined abort (); + undefined changeType (DOMString type); undefined remove (double start, unrestricted double end); }; diff --git a/interfaces/payment-handler.idl b/interfaces/payment-handler.idl index 7636e8a3b49b3b8..5360a837aab5792 100644 --- a/interfaces/payment-handler.idl +++ b/interfaces/payment-handler.idl @@ -75,7 +75,6 @@ interface PaymentRequestEvent : ExtendableEvent { readonly attribute FrozenArray methodData; readonly attribute object total; readonly attribute FrozenArray modifiers; - readonly attribute DOMString instrumentKey; Promise openWindow(USVString url); Promise changePaymentMethod(DOMString methodName, optional object? methodDetails = null); undefined respondWith(Promise handlerResponsePromise); @@ -88,7 +87,6 @@ dictionary PaymentRequestEventInit : ExtendableEventInit { sequence methodData; PaymentCurrencyAmount total; sequence modifiers; - DOMString instrumentKey; }; dictionary PaymentHandlerResponse { 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/permissions.idl b/interfaces/permissions.idl index 0ad42ff0b24601a..450eea90602a84d 100644 --- a/interfaces/permissions.idl +++ b/interfaces/permissions.idl @@ -41,9 +41,9 @@ enum PermissionName { "background-sync", "bluetooth", "camera", - "clipboard-write", "device-info", "display-capture", + "gamepad", "geolocation", "gyroscope", "magnetometer", @@ -53,6 +53,7 @@ enum PermissionName { "notifications", "persistent-storage", "push", + "screen-wake-lock", "speaker-selection", }; diff --git a/interfaces/pointerlock.idl b/interfaces/pointerlock.idl index 873a965ce824816..0204bf53424826b 100644 --- a/interfaces/pointerlock.idl +++ b/interfaces/pointerlock.idl @@ -18,11 +18,11 @@ partial interface mixin DocumentOrShadowRoot { }; partial interface MouseEvent { - readonly attribute long movementX; - readonly attribute long movementY; + readonly attribute double movementX; + readonly attribute double movementY; }; partial dictionary MouseEventInit { - long movementX = 0; - long movementY = 0; + double movementX = 0; + double movementY = 0; }; diff --git a/interfaces/resource-timing.idl b/interfaces/resource-timing.idl index 112266865bb8c5c..235963b804bf9a8 100644 --- a/interfaces/resource-timing.idl +++ b/interfaces/resource-timing.idl @@ -5,28 +5,28 @@ [Exposed=(Window,Worker)] interface PerformanceResourceTiming : PerformanceEntry { - readonly attribute DOMString initiatorType; - readonly attribute DOMString nextHopProtocol; - readonly attribute DOMHighResTimeStamp workerStart; - readonly attribute DOMHighResTimeStamp redirectStart; - readonly attribute DOMHighResTimeStamp redirectEnd; - readonly attribute DOMHighResTimeStamp fetchStart; - readonly attribute DOMHighResTimeStamp domainLookupStart; - readonly attribute DOMHighResTimeStamp domainLookupEnd; - readonly attribute DOMHighResTimeStamp connectStart; - readonly attribute DOMHighResTimeStamp connectEnd; - readonly attribute DOMHighResTimeStamp secureConnectionStart; - readonly attribute DOMHighResTimeStamp requestStart; - readonly attribute DOMHighResTimeStamp responseStart; - readonly attribute DOMHighResTimeStamp responseEnd; - readonly attribute unsigned long long transferSize; - readonly attribute unsigned long long encodedBodySize; - readonly attribute unsigned long long decodedBodySize; + readonly attribute DOMString initiatorType; + readonly attribute ByteString nextHopProtocol; + readonly attribute DOMHighResTimeStamp workerStart; + readonly attribute DOMHighResTimeStamp redirectStart; + readonly attribute DOMHighResTimeStamp redirectEnd; + readonly attribute DOMHighResTimeStamp fetchStart; + readonly attribute DOMHighResTimeStamp domainLookupStart; + readonly attribute DOMHighResTimeStamp domainLookupEnd; + readonly attribute DOMHighResTimeStamp connectStart; + readonly attribute DOMHighResTimeStamp connectEnd; + readonly attribute DOMHighResTimeStamp secureConnectionStart; + readonly attribute DOMHighResTimeStamp requestStart; + readonly attribute DOMHighResTimeStamp responseStart; + readonly attribute DOMHighResTimeStamp responseEnd; + readonly attribute unsigned long long transferSize; + readonly attribute unsigned long long encodedBodySize; + readonly attribute unsigned long long decodedBodySize; [Default] object toJSON(); }; partial interface Performance { undefined clearResourceTimings (); undefined setResourceTimingBufferSize (unsigned long maxSize); - attribute EventHandler onresourcetimingbufferfull; + attribute EventHandler onresourcetimingbufferfull; }; diff --git a/interfaces/sanitizer-api.idl b/interfaces/sanitizer-api.idl index 9db926c478cae7e..b98da2a2c671e2e 100644 --- a/interfaces/sanitizer-api.idl +++ b/interfaces/sanitizer-api.idl @@ -9,14 +9,16 @@ ] interface Sanitizer { constructor(optional SanitizerConfig config = {}); - DocumentFragment sanitize(SanitizerInput input); - DOMString sanitizeToString(SanitizerInput input); + DocumentFragment sanitize((Document or DocumentFragment) input); + Element? sanitizeFor(DOMString element, DOMString input); - SanitizerConfig config(); - static SanitizerConfig defaultConfig(); + SanitizerConfig getConfiguration(); + static SanitizerConfig getDefaultConfiguration(); }; -typedef (DOMString or DocumentFragment or Document) SanitizerInput; +partial interface Element { + undefined setHTML(DOMString input, Sanitizer sanitizer); +}; dictionary SanitizerConfig { sequence allowElements; @@ -25,6 +27,7 @@ dictionary SanitizerConfig { AttributeMatchList allowAttributes; AttributeMatchList dropAttributes; boolean allowCustomElements; + boolean allowComments; }; typedef record> AttributeMatchList; diff --git a/interfaces/screen-capture.idl b/interfaces/screen-capture.idl index 7786b7fb4d7c9af..5fb7eb852c1670b 100644 --- a/interfaces/screen-capture.idl +++ b/interfaces/screen-capture.idl @@ -17,6 +17,7 @@ partial dictionary MediaTrackSupportedConstraints { boolean logicalSurface = true; boolean cursor = true; boolean restrictOwnAudio = true; + boolean suppressLocalAudioPlayback = true; }; partial dictionary MediaTrackConstraintSet { @@ -24,12 +25,20 @@ partial dictionary MediaTrackConstraintSet { ConstrainBoolean logicalSurface; ConstrainDOMString cursor; ConstrainBoolean restrictOwnAudio; + ConstrainBoolean suppressLocalAudioPlayback; }; partial dictionary MediaTrackSettings { DOMString displaySurface; boolean logicalSurface; DOMString cursor; + boolean restrictOwnAudio; +}; + +partial dictionary MediaTrackCapabilities { + DOMString displaySurface; + boolean logicalSurface; + sequence cursor; }; enum DisplayCaptureSurfaceType { diff --git a/interfaces/scroll-animations.idl b/interfaces/scroll-animations.idl index 872c1dde607d22e..cdad9c3824556b4 100644 --- a/interfaces/scroll-animations.idl +++ b/interfaces/scroll-animations.idl @@ -19,7 +19,6 @@ dictionary ScrollTimelineOptions { Element? source; ScrollDirection orientation = "block"; sequence scrollOffsets = []; - (double or ScrollTimelineAutoKeyword) timeRange = "auto"; }; [Exposed=Window] @@ -28,7 +27,6 @@ interface ScrollTimeline : AnimationTimeline { readonly attribute Element? source; readonly attribute ScrollDirection orientation; readonly attribute FrozenArray scrollOffsets; - readonly attribute (double or ScrollTimelineAutoKeyword) timeRange; }; enum Edge { "start", "end" }; @@ -45,5 +43,4 @@ interface CSSScrollTimelineRule : CSSRule { readonly attribute CSSOMString source; readonly attribute CSSOMString orientation; readonly attribute CSSOMString scrollOffsets; - readonly attribute CSSOMString timeRange; }; diff --git a/interfaces/streams.idl b/interfaces/streams.idl index 99c3a5dee91f693..8ef195b957ba90c 100644 --- a/interfaces/streams.idl +++ b/interfaces/streams.idl @@ -159,6 +159,8 @@ interface WritableStreamDefaultWriter { [Exposed=(Window,Worker,Worklet)] interface WritableStreamDefaultController { + readonly attribute any abortReason; + readonly attribute AbortSignal signal; undefined error(optional any e); }; diff --git a/interfaces/uuid.idl b/interfaces/uuid.idl new file mode 100644 index 000000000000000..92bed2973f5f427 --- /dev/null +++ b/interfaces/uuid.idl @@ -0,0 +1,9 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: uuid (https://wicg.github.io/uuid/) + +[Exposed=(Window,Worker)] +partial interface Crypto { + [SecureContext] DOMString randomUUID(); +}; 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/web-animations-2.idl b/interfaces/web-animations-2.idl index bf4f9aa1846e5b8..2bc7aa412c0f72a 100644 --- a/interfaces/web-animations-2.idl +++ b/interfaces/web-animations-2.idl @@ -5,6 +5,7 @@ [Exposed=Window] partial interface AnimationTimeline { + readonly attribute CSSNumberish? duration; Animation play (optional AnimationEffect? effect = null); }; @@ -30,7 +31,11 @@ partial dictionary OptionalEffectTiming { }; partial dictionary ComputedEffectTiming { - double startTime; + CSSNumberish startTime; + CSSNumberish endTime; + CSSNumberish activeDuration; + CSSNumberish? localTime; + CSSNumberish? progress; }; [Exposed=Window] diff --git a/interfaces/web-animations.idl b/interfaces/web-animations.idl index 6e973d195e382d1..626c823566744d0 100644 --- a/interfaces/web-animations.idl +++ b/interfaces/web-animations.idl @@ -86,10 +86,6 @@ enum FillMode { "none", "forwards", "backwards", "both", "auto" }; enum PlaybackDirection { "normal", "reverse", "alternate", "alternate-reverse" }; dictionary ComputedEffectTiming : EffectTiming { - unrestricted double endTime; - unrestricted double activeDuration; - double? localTime; - double? progress; unrestricted double? currentIteration; }; diff --git a/interfaces/webcodecs.idl b/interfaces/webcodecs.idl index 1203ebae3efe15f..39bef9add4da6f3 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,18 @@ 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; + SvcOutputMetadata svc; +}; + +dictionary SvcOutputMetadata { + unsigned long temporalLayerId; +}; dictionary AudioDecoderSupport { boolean supported; @@ -117,40 +134,39 @@ 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; + BitrateMode bitrateMode = "variable"; + LatencyMode latencyMode = "quality"; }; enum HardwareAcceleration { @@ -159,6 +175,11 @@ enum HardwareAcceleration { "require", }; +enum LatencyMode { + "quality", + "realtime" +}; + dictionary VideoEncoderEncodeOptions { boolean keyFrame = false; }; @@ -176,14 +197,15 @@ interface EncodedAudioChunk { constructor(EncodedAudioChunkInit init); readonly attribute EncodedAudioChunkType type; readonly attribute long long timestamp; // microseconds + readonly attribute unsigned long duration; // microseconds readonly attribute unsigned long byteLength; - undefined copyTo(ArrayBufferView dst); + undefined copyTo([AllowShared] BufferSource destination); }; dictionary EncodedAudioChunkInit { required EncodedAudioChunkType type; - required long long timestamp; // microseconds + [EnforceRange] required long long timestamp; // microseconds required BufferSource data; }; @@ -196,17 +218,17 @@ enum EncodedAudioChunkType { interface EncodedVideoChunk { constructor(EncodedVideoChunkInit init); readonly attribute EncodedVideoChunkType type; - readonly attribute long long timestamp; // microseconds - readonly attribute long long? duration; // microseconds + readonly attribute long long timestamp; // microseconds + readonly attribute unsigned long long? duration; // microseconds readonly attribute unsigned long byteLength; - undefined copyTo(ArrayBufferView dst); + undefined copyTo([AllowShared] BufferSource destination); }; dictionary EncodedVideoChunkInit { required EncodedVideoChunkType type; - required long long timestamp; // microseconds - long long duration; // microseconds + [EnforceRange] required long long timestamp; // microseconds + [EnforceRange] unsigned long long duration; // microseconds required BufferSource data; }; @@ -215,97 +237,105 @@ enum EncodedVideoChunkType { "delta", }; -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable, Transferable] interface AudioData { constructor(AudioDataInit init); - readonly attribute AudioSampleFormat sampleFormat; + readonly attribute AudioSampleFormat format; 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 + readonly attribute unsigned 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 + required AudioSampleFormat format; + [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", }; -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable, Transferable] interface VideoFrame { constructor(CanvasImageSource image, optional VideoFrameInit init = {}); - constructor(sequence<(Plane or PlaneInit)> planes, + constructor(sequence planes, VideoFramePlaneInit init); readonly attribute PixelFormat format; - readonly attribute FrozenArray? planes; readonly attribute unsigned long codedWidth; readonly attribute unsigned long codedHeight; - readonly attribute unsigned long cropLeft; - readonly attribute unsigned long cropTop; - readonly attribute unsigned long cropWidth; - readonly attribute unsigned long cropHeight; + readonly attribute DOMRectReadOnly? codedRect; + readonly attribute DOMRectReadOnly? visibleRect; readonly attribute unsigned long displayWidth; readonly attribute unsigned long displayHeight; - readonly attribute long long? duration; // microseconds - readonly attribute long long? timestamp; // microseconds - + readonly attribute unsigned long long? duration; // microseconds + readonly attribute long long? timestamp; // microseconds + unsigned long allocationSize( + optional VideoFrameCopyToOptions options = {}); + Promise> copyTo( + [AllowShared] BufferSource destination, + optional VideoFrameCopyToOptions options = {}); VideoFrame clone(); undefined close(); }; dictionary VideoFrameInit { - long long duration; // microseconds - long long timestamp; // microseconds + unsigned long long duration; // microseconds + long long timestamp; // microseconds }; 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; + DOMRectInit visibleRect; + [EnforceRange] unsigned long displayWidth; + [EnforceRange] unsigned long displayHeight; + [EnforceRange] unsigned long long duration; // microseconds + [EnforceRange] long long timestamp; // microseconds }; -[Exposed=(Window,DedicatedWorker)] -interface Plane { - readonly attribute unsigned long stride; - readonly attribute unsigned long rows; - readonly attribute unsigned long length; +dictionary PlaneInit { + required BufferSource data; + [EnforceRange] required unsigned long stride; + [EnforceRange] unsigned long offset = 0; +}; - undefined readInto(ArrayBufferView dst); +dictionary VideoFrameCopyToOptions { + DOMRectInit rect; + sequence layout; }; -dictionary PlaneInit { - required BufferSource src; - required unsigned long stride; - required unsigned long rows; +dictionary PlaneLayout { + [EnforceRange] required unsigned long offset; + [EnforceRange] required unsigned long stride; }; enum PixelFormat { @@ -333,13 +363,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 +383,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 90% rename from interfaces/gpuweb.idl rename to interfaces/webgpu.idl index 3f7111820a726ad..bc5f84d708371ae 100644 --- a/interfaces/gpuweb.idl +++ b/interfaces/webgpu.idl @@ -11,8 +11,8 @@ dictionary GPUObjectDescriptorBase { USVString label; }; -[Exposed=Window] -interface GPUAdapterLimits { +[Exposed=(Window, DedicatedWorker)] +interface GPUSupportedLimits { readonly attribute unsigned long maxTextureDimension1D; readonly attribute unsigned long maxTextureDimension2D; readonly attribute unsigned long maxTextureDimension3D; @@ -25,14 +25,20 @@ interface GPUAdapterLimits { readonly attribute unsigned long maxStorageBuffersPerShaderStage; readonly attribute unsigned long maxStorageTexturesPerShaderStage; readonly attribute unsigned long maxUniformBuffersPerShaderStage; - readonly attribute unsigned long maxUniformBufferBindingSize; - readonly attribute unsigned long maxStorageBufferBindingSize; + 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 maxVertexAttributes; readonly attribute unsigned long maxVertexBufferArrayStride; + readonly attribute unsigned long maxInterStageShaderComponents; + readonly attribute unsigned long maxComputeWorkgroupStorageSize; + readonly attribute unsigned long maxComputeWorkgroupInvocations; + readonly attribute unsigned long maxComputePerDimensionDispatchSize; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUSupportedFeatures { readonly setlike; }; @@ -54,6 +60,7 @@ interface GPU { dictionary GPURequestAdapterOptions { GPUPowerPreference powerPreference; + boolean forceSoftware = false; }; enum GPUPowerPreference { @@ -61,18 +68,19 @@ enum GPUPowerPreference { "high-performance" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUAdapter { readonly attribute DOMString name; [SameObject] readonly attribute GPUSupportedFeatures features; - [SameObject] readonly attribute GPUAdapterLimits limits; + [SameObject] readonly attribute GPUSupportedLimits limits; + readonly attribute boolean isSoftware; Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); }; dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { - sequence nonGuaranteedFeatures = []; - record nonGuaranteedLimits = {}; + sequence requiredFeatures = []; + record requiredLimits = {}; }; enum GPUFeatureName { @@ -84,10 +92,10 @@ enum GPUFeatureName { "timestamp-query", }; -[Exposed=(Window, DedicatedWorker), Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; - readonly attribute object limits; + [SameObject] readonly attribute GPUSupportedLimits limits; [SameObject] readonly attribute GPUQueue queue; @@ -115,7 +123,7 @@ interface GPUDevice : EventTarget { }; GPUDevice includes GPUObjectBase; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUBuffer { Promise mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size); ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size); @@ -132,7 +140,7 @@ dictionary GPUBufferDescriptor : GPUObjectDescriptorBase { }; typedef [EnforceRange] unsigned long GPUBufferUsageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUBufferUsage { const GPUFlagsConstant MAP_READ = 0x0001; const GPUFlagsConstant MAP_WRITE = 0x0002; @@ -147,13 +155,13 @@ interface GPUBufferUsage { }; typedef [EnforceRange] unsigned long GPUMapModeFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUMapMode { const GPUFlagsConstant READ = 0x0001; const GPUFlagsConstant WRITE = 0x0002; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUTexture { GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {}); @@ -177,16 +185,16 @@ enum GPUTextureDimension { }; typedef [EnforceRange] unsigned long GPUTextureUsageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUTextureUsage { const GPUFlagsConstant COPY_SRC = 0x01; const GPUFlagsConstant COPY_DST = 0x02; - const GPUFlagsConstant SAMPLED = 0x04; + const GPUFlagsConstant SHADER_READ = 0x04; const GPUFlagsConstant STORAGE = 0x08; const GPUFlagsConstant RENDER_ATTACHMENT = 0x10; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUTextureView { }; GPUTextureView includes GPUObjectBase; @@ -295,7 +303,7 @@ enum GPUTextureFormat { "depth32float-stencil8", }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUExternalTexture { }; GPUExternalTexture includes GPUObjectBase; @@ -305,7 +313,7 @@ dictionary GPUExternalTextureDescriptor : GPUObjectDescriptorBase { GPUPredefinedColorSpace colorSpace = "srgb"; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUSampler { }; GPUSampler includes GPUObjectBase; @@ -345,7 +353,7 @@ enum GPUCompareFunction { "always" }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroupLayout { }; GPUBindGroupLayout includes GPUObjectBase; @@ -355,7 +363,7 @@ dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { }; typedef [EnforceRange] unsigned long GPUShaderStageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUShaderStage { const GPUFlagsConstant VERTEX = 0x1; const GPUFlagsConstant FRAGMENT = 0x2; @@ -410,12 +418,11 @@ dictionary GPUTextureBindingLayout { }; enum GPUStorageTextureAccess { - "read-only", "write-only", }; dictionary GPUStorageTextureBindingLayout { - required GPUStorageTextureAccess access; + GPUStorageTextureAccess access = "write-only"; required GPUTextureFormat format; GPUTextureViewDimension viewDimension = "2d"; }; @@ -423,7 +430,7 @@ dictionary GPUStorageTextureBindingLayout { dictionary GPUExternalTextureBindingLayout { }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroup { }; GPUBindGroup includes GPUObjectBase; @@ -446,7 +453,7 @@ dictionary GPUBufferBinding { GPUSize64 size; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUPipelineLayout { }; GPUPipelineLayout includes GPUObjectBase; @@ -455,7 +462,7 @@ dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { required sequence bindGroupLayouts; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUShaderModule { Promise compilationInfo(); }; @@ -472,7 +479,7 @@ enum GPUCompilationMessageType { "info" }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationMessage { readonly attribute DOMString message; readonly attribute GPUCompilationMessageType type; @@ -482,7 +489,7 @@ interface GPUCompilationMessage { readonly attribute unsigned long long length; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationInfo { readonly attribute FrozenArray messages; }; @@ -498,9 +505,12 @@ interface mixin GPUPipelineBase { dictionary GPUProgrammableStage { required GPUShaderModule module; required USVString entryPoint; + record constants; }; -[Exposed=Window, Serializable] +typedef double GPUPipelineConstantValue; // May represent WGSL’s bool, f32, i32, u32. + +[Exposed=(Window, DedicatedWorker)] interface GPUComputePipeline { }; GPUComputePipeline includes GPUObjectBase; @@ -510,7 +520,7 @@ dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { required GPUProgrammableStage compute; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPipeline { }; GPURenderPipeline includes GPUObjectBase; @@ -576,7 +586,7 @@ dictionary GPUBlendState { }; typedef [EnforceRange] unsigned long GPUColorWriteFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUColorWrite { const GPUFlagsConstant RED = 0x1; const GPUFlagsConstant GREEN = 0x2; @@ -688,7 +698,7 @@ enum GPUVertexFormat { "sint32x4", }; -enum GPUInputStepMode { +enum GPUVertexStepMode { "vertex", "instance" }; @@ -699,7 +709,7 @@ dictionary GPUVertexState: GPUProgrammableStage { dictionary GPUVertexBufferLayout { required GPUSize64 arrayStride; - GPUInputStepMode stepMode = "vertex"; + GPUVertexStepMode stepMode = "vertex"; required sequence attributes; }; @@ -710,7 +720,7 @@ dictionary GPUVertexAttribute { required GPUIndex32 shaderLocation; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandBuffer { readonly attribute Promise executionTime; }; @@ -719,7 +729,7 @@ GPUCommandBuffer includes GPUObjectBase; dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandEncoder { GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {}); @@ -786,6 +796,11 @@ dictionary GPUImageCopyTexture { GPUTextureAspect aspect = "all"; }; +dictionary GPUImageCopyTextureTagged : GPUImageCopyTexture { + GPUPredefinedColorSpace colorSpace = "srgb"; + boolean premultipliedAlpha = false; +}; + dictionary GPUImageCopyExternalImage { required (ImageBitmap or HTMLCanvasElement or OffscreenCanvas) source; GPUOrigin2D origin = {}; @@ -805,7 +820,7 @@ interface mixin GPUProgrammablePassEncoder { undefined insertDebugMarker(USVString markerLabel); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUComputePassEncoder { undefined setPipeline(GPUComputePipeline pipeline); undefined dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1); @@ -827,8 +842,8 @@ dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase { interface mixin GPURenderEncoderBase { undefined setPipeline(GPURenderPipeline pipeline); - undefined setIndexBuffer(GPUBuffer buffer, GPUIndexFormat indexFormat, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); - undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); + 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); @@ -841,7 +856,7 @@ interface mixin GPURenderEncoderBase { undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPassEncoder { undefined setViewport(float x, float y, float width, float height, @@ -900,10 +915,10 @@ enum GPULoadOp { enum GPUStoreOp { "store", - "clear" + "discard" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundle { }; GPURenderBundle includes GPUObjectBase; @@ -911,7 +926,7 @@ GPURenderBundle includes GPUObjectBase; dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase { }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundleEncoder { GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {}); }; @@ -925,7 +940,7 @@ dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase { GPUSize32 sampleCount = 1; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUQueue { undefined submit(sequence commandBuffers); @@ -946,12 +961,12 @@ interface GPUQueue { undefined copyExternalImageToTexture( GPUImageCopyExternalImage source, - GPUImageCopyTexture destination, + GPUImageCopyTextureTagged destination, GPUExtent3D copySize); }; GPUQueue includes GPUObjectBase; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUQuerySet { undefined destroy(); }; @@ -977,11 +992,15 @@ enum GPUPipelineStatisticName { "compute-shader-invocations" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUCanvasContext { - GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor); + readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas; + + undefined configure(GPUCanvasConfiguration configuration); + undefined unconfigure(); - GPUTextureFormat getSwapChainPreferredFormat(GPUAdapter adapter); + GPUTextureFormat getPreferredFormat(GPUAdapter adapter); + GPUTexture getCurrentTexture(); }; enum GPUCanvasCompositingAlphaMode { @@ -989,24 +1008,20 @@ enum GPUCanvasCompositingAlphaMode { "premultiplied", }; -dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase { +dictionary GPUCanvasConfiguration { required GPUDevice device; required GPUTextureFormat format; GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT + GPUPredefinedColorSpace colorSpace = "srgb"; GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque"; + GPUExtent3D size; }; -[Exposed=Window] -interface GPUSwapChain { - GPUTexture getCurrentTexture(); -}; -GPUSwapChain includes GPUObjectBase; - enum GPUDeviceLostReason { "destroyed", }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUDeviceLostInfo { readonly attribute (GPUDeviceLostReason or undefined) reason; readonly attribute DOMString message; @@ -1021,12 +1036,12 @@ enum GPUErrorFilter { "validation" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUOutOfMemoryError { constructor(); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUValidationError { constructor(DOMString message); readonly attribute DOMString message; diff --git a/interfaces/webhid.idl b/interfaces/webhid.idl index ffc960938c9221c..d4ce439785d866a 100644 --- a/interfaces/webhid.idl +++ b/interfaces/webhid.idl @@ -3,21 +3,11 @@ // (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 filters; +[SecureContext] partial interface Navigator { + [SameObject] readonly attribute HID hid; }; -[ - Exposed=Window, - SecureContext -] +[Exposed=Window, SecureContext] interface HID : EventTarget { attribute EventHandler onconnect; attribute EventHandler ondisconnect; @@ -26,41 +16,71 @@ interface HID : EventTarget { HIDDeviceRequestOptions options); }; -[SecureContext] partial interface Navigator { - [SameObject] readonly attribute HID hid; +dictionary HIDDeviceRequestOptions { + required sequence filters; }; -dictionary HIDConnectionEventInit : EventInit { - required HIDDevice device; +dictionary HIDDeviceFilter { + unsigned long vendorId; + unsigned short productId; + unsigned short usagePage; + unsigned short usage; }; -[ - Exposed=Window, - SecureContext -] interface HIDConnectionEvent : Event { +[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 collections; + Promise open(); + Promise close(); + Promise sendReport([EnforceRange] octet reportId, BufferSource data); + Promise sendFeatureReport( + [EnforceRange] octet reportId, + BufferSource data); + Promise receiveFeatureReport([EnforceRange] octet reportId); +}; + +[Exposed=Window, SecureContext] +interface HIDConnectionEvent : Event { constructor(DOMString type, HIDConnectionEventInit eventInitDict); [SameObject] readonly attribute HIDDevice device; }; -dictionary HIDInputReportEventInit : EventInit { +dictionary HIDConnectionEventInit : EventInit { required HIDDevice device; - required octet reportId; - required DataView data; }; -[ - Exposed=Window, - SecureContext -] interface HIDInputReportEvent : Event { +[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 HIDInputReportEventInit : EventInit { + required HIDDevice device; + required octet reportId; + required DataView data; +}; + +dictionary HIDCollectionInfo { + unsigned short usagePage; + unsigned short usage; + octet type; + sequence children; + sequence inputReports; + sequence outputReports; + sequence featureReports; +}; + +dictionary HIDReportInfo { + octet reportId; + sequence items; }; dictionary HIDReportItem { @@ -94,34 +114,7 @@ dictionary HIDReportItem { sequence strings; }; -dictionary HIDReportInfo { - octet reportId; - sequence items; -}; - -dictionary HIDCollectionInfo { - unsigned short usagePage; - unsigned short usage; - octet type; - sequence children; - sequence inputReports; - sequence outputReports; - sequence 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 collections; - Promise open(); - Promise close(); - Promise sendReport([EnforceRange] octet reportId, BufferSource data); - Promise sendFeatureReport([EnforceRange] octet reportId, BufferSource data); - Promise receiveFeatureReport([EnforceRange] octet reportId); +enum HIDUnitSystem { + "none", "si-linear", "si-rotation", "english-linear", + "english-rotation", "vendor-defined", "reserved" }; diff --git a/interfaces/webnn.idl b/interfaces/webnn.idl new file mode 100644 index 000000000000000..cb04a492686711f --- /dev/null +++ b/interfaces/webnn.idl @@ -0,0 +1,448 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Web Neural Network API (https://webmachinelearning.github.io/webnn/) + +interface mixin NavigatorML { + [SecureContext, SameObject] readonly attribute ML ml; +}; +Navigator includes NavigatorML; +WorkerNavigator includes NavigatorML; + +enum MLDevicePreference { + "default", + "gpu", + "cpu" +}; + +enum MLPowerPreference { + // Let the user agent select the most suitable behavior. + "default", + + // Prioritizes execution speed over power consumption. + "high-performance", + + // Prioritizes power consumption over other considerations such as execution speed. + "low-power" +}; + +dictionary MLContextOptions { + // Preferred kind of device used + MLDevicePreference devicePreference = "default"; + + // Preference as related to power consumption + MLPowerPreference powerPreference = "default"; +}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface ML { + // Create a context with options + MLContext createContext(optional MLContextOptions options = {}); + + // Create a context from WebGL rendering context + MLContext createContext(WebGLRenderingContext glContext); + + // Create a context from WebGPU device + MLContext createContext(GPUDevice gpuDevice); +}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLContext {}; + +enum MLInputOperandLayout { + "nchw", + "nhwc" +}; + +enum MLOperandType { + "float32", + "float16", + "int32", + "uint32", + "int8", + "uint8" +}; + +dictionary MLOperandDescriptor { + // The operand type. + required MLOperandType type; + + // The dimensions field is only required for tensor operands. + // The negative value means an unknown dimension. + sequence dimensions; +}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLOperand {}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLOperator {}; + +typedef record MLNamedOperands; + +dictionary MLBufferResourceView { + required (WebGLBuffer or GPUBuffer) resource; + unsigned long long offset = 0; + unsigned long long size; +}; + +typedef (ArrayBufferView or MLBufferResourceView) MLBufferView; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLGraphBuilder { + // Construct the graph builder from the context. + constructor(MLContext context); + + // Create an operand for a graph input. + MLOperand input(DOMString name, MLOperandDescriptor desc); + + // Create an operand for a graph constant. + MLOperand constant(MLOperandDescriptor desc, MLBufferView bufferView); + + // Create a single-value operand from the specified number of the specified type. + MLOperand constant(double value, optional MLOperandType type = "float32"); + + // Compile the graph up to the specified output operands + MLGraph build(MLNamedOperands outputs); +}; + +dictionary MLBatchNormalizationOptions { + MLOperand scale; + MLOperand bias; + long axis = 1; + float epsilon = 1e-5; + MLOperator activation; +}; + +partial interface MLGraphBuilder { + MLOperand batchNormalization(MLOperand input, MLOperand mean, MLOperand variance, + optional MLBatchNormalizationOptions options = {}); +}; + +dictionary MLClampOptions { + MLOperand minValue; + MLOperand maxValue; +}; + +partial interface MLGraphBuilder { + MLOperand clamp(MLOperand x, optional MLClampOptions options = {}); + MLOperator clamp(optional MLClampOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand concat(sequence inputs, long axis); +}; + +enum MLFilterOperandLayout { + "oihw", + "hwio", + "ohwi", + "ihwo" +}; + +enum MLAutoPad { + "explicit", + "same-upper", + "same-lower" +}; + +dictionary MLConv2dOptions { + sequence padding; + sequence strides; + sequence dilations; + sequence outputPadding; + sequence outputSizes; + MLAutoPad autoPad = "explicit"; + boolean transpose = false; + long groups = 1; + MLInputOperandLayout inputLayout = "nchw"; + MLFilterOperandLayout filterLayout = "oihw"; + MLOperand bias; + MLOperator activation; +}; + +partial interface MLGraphBuilder { + MLOperand conv2d(MLOperand input, MLOperand filter, optional MLConv2dOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand add(MLOperand a, MLOperand b); + MLOperand sub(MLOperand a, MLOperand b); + MLOperand mul(MLOperand a, MLOperand b); + MLOperand div(MLOperand a, MLOperand b); + MLOperand max(MLOperand a, MLOperand b); + MLOperand min(MLOperand a, MLOperand b); + MLOperand pow(MLOperand a, MLOperand b); +}; + +partial interface MLGraphBuilder { + MLOperand abs(MLOperand x); + MLOperand ceil(MLOperand x); + MLOperand cos(MLOperand x); + MLOperand exp(MLOperand x); + MLOperand floor(MLOperand x); + MLOperand log(MLOperand x); + MLOperand neg(MLOperand x); + MLOperand sin(MLOperand x); + MLOperand tan(MLOperand x); +}; + +dictionary MLEluOptions { + float alpha = 1; +}; + +partial interface MLGraphBuilder { + MLOperand elu(MLOperand x, optional MLEluOptions options = {}); + MLOperator elu(optional MLEluOptions options = {}); +}; + +dictionary MLGemmOptions { + MLOperand c; + float alpha = 1.0; + float beta = 1.0; + boolean aTranspose = false; + boolean bTranspose = false; +}; + +partial interface MLGraphBuilder { + MLOperand gemm(MLOperand a, MLOperand b, optional MLGemmOptions options = {}); +}; + +enum MLRecurrentNetworkWeightLayout { + "zrn", // update-reset-new gate ordering + "rzn" // reset-update-new gate ordering +}; + +enum MLRecurrentNetworkDirection { + "forward", + "backward", + "both" +}; + +dictionary MLGruOptions { + MLOperand bias; + MLOperand recurrentBias; + MLOperand initialHiddenState; + boolean resetAfter = true; + boolean returnSequence = false; + MLRecurrentNetworkDirection direction = "forward"; + MLRecurrentNetworkWeightLayout layout = "zrn"; + sequence activations; +}; + +partial interface MLGraphBuilder { + sequence gru(MLOperand input, MLOperand weight, MLOperand recurrentWeight, + + long steps, long hiddenSize, optional MLGruOptions options = {}); +}; + +dictionary MLGruCellOptions { + MLOperand bias; + MLOperand recurrentBias; + boolean resetAfter = true; + MLRecurrentNetworkWeightLayout layout = "zrn"; + sequence activations; +}; + +partial interface MLGraphBuilder { + MLOperand gruCell(MLOperand input, MLOperand weight, MLOperand recurrentWeight, + + MLOperand hiddenState, long hiddenSize, optional MLGruCellOptions options = {}); +}; + +dictionary MLHardSigmoidOptions { + float alpha = 0.2; + float beta = 0.5; +}; + +partial interface MLGraphBuilder { + MLOperand hardSigmoid(MLOperand x, optional MLHardSigmoidOptions options = {}); + MLOperator hardSigmoid(optional MLHardSigmoidOptions options = {}); +}; + +dictionary MLInstanceNormalizationOptions { + MLOperand scale; + MLOperand bias; + float epsilon = 1e-5; + MLInputOperandLayout layout = "nchw"; +}; + +partial interface MLGraphBuilder { + MLOperand instanceNormalization(MLOperand input, + + optional MLInstanceNormalizationOptions options = {}); +}; + +dictionary MLLeakyReluOptions { + float alpha = 0.01; +}; + +partial interface MLGraphBuilder { + MLOperand leakyRelu(MLOperand x, optional MLLeakyReluOptions options = {}); + MLOperator leakyRelu(optional MLLeakyReluOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand matmul(MLOperand a, MLOperand b); +}; + +dictionary MLLinearOptions { + float alpha = 1; + float beta = 0; +}; + +partial interface MLGraphBuilder { + MLOperand linear(MLOperand x, optional MLLinearOptions options = {}); + MLOperator linear(optional MLLinearOptions options = {}); +}; + +enum MLPaddingMode { + "constant", + "edge", + "reflection", + "symmetric" +}; + +dictionary MLPadOptions { + MLPaddingMode mode = "constant"; + float value = 0; +}; + +partial interface MLGraphBuilder { + MLOperand pad(MLOperand input, MLOperand padding, optional MLPadOptions options = {}); +}; + +dictionary MLPool2dOptions { + sequence windowDimensions; + sequence padding; + sequence strides; + sequence dilations; + MLAutoPad autoPad = "explicit"; + MLInputOperandLayout layout = "nchw"; +}; + +partial interface MLGraphBuilder { + MLOperand averagePool2d(MLOperand input, optional MLPool2dOptions options = {}); + MLOperand l2Pool2d(MLOperand input, optional MLPool2dOptions options = {}); + MLOperand maxPool2d(MLOperand input, optional MLPool2dOptions options = {}); +}; + +dictionary MLReduceOptions { + sequence axes = null; + boolean keepDimensions = false; +}; + +partial interface MLGraphBuilder { + MLOperand reduceL1(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceL2(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceLogSum(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceLogSumExp(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceMax(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceMean(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceMin(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceProduct(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceSum(MLOperand input, optional MLReduceOptions options = {}); + MLOperand reduceSumSquare(MLOperand input, optional MLReduceOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand relu(MLOperand x); + MLOperator relu(); +}; + +enum MLInterpolationMode { + "nearest-neighbor", + "linear" +}; + +dictionary MLResampleOptions { + MLInterpolationMode mode = "nearest-neighbor"; + sequence scales; + sequence sizes; +}; + +partial interface MLGraphBuilder { + MLOperand resample(MLOperand input, optional MLResampleOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand reshape(MLOperand input, sequence newShape); +}; + +partial interface MLGraphBuilder { + MLOperand sigmoid(MLOperand x); + MLOperator sigmoid(); +}; + +dictionary MLSliceOptions { + sequence axes; +}; + +partial interface MLGraphBuilder { + MLOperand slice(MLOperand input, sequence starts, sequence sizes, + optional MLSliceOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand softmax(MLOperand x); +}; + +dictionary MLSoftplusOptions { + float steepness = 1; +}; + +partial interface MLGraphBuilder { + MLOperand softplus(MLOperand x, optional MLSoftplusOptions options = {}); + MLOperator softplus(optional MLSoftplusOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand softsign(MLOperand x); + MLOperator softsign(); +}; + +dictionary MLSplitOptions { + long axis = 0; +}; + +partial interface MLGraphBuilder { + sequence split(MLOperand input, + (unsigned long or sequence) splits, + optional MLSplitOptions options = {}); +}; + +dictionary MLSqueezeOptions { + sequence axes; +}; + +partial interface MLGraphBuilder { + MLOperand squeeze(MLOperand input, optional MLSqueezeOptions options = {}); +}; + +partial interface MLGraphBuilder { + MLOperand tanh(MLOperand x); + MLOperator tanh(); +}; + +dictionary MLTransposeOptions { + sequence permutation; +}; + +partial interface MLGraphBuilder { + MLOperand transpose(MLOperand input, optional MLTransposeOptions options = {}); +}; + +typedef (MLBufferView or WebGLTexture or GPUTexture) MLResource; + +dictionary MLInput { + required MLResource resource; + required sequence dimensions; +}; + +typedef record MLNamedInputs; +typedef record MLNamedOutputs; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLGraph { + undefined compute(MLNamedInputs inputs, MLNamedOutputs outputs); +}; diff --git a/interfaces/webrtc-encoded-transform.idl b/interfaces/webrtc-encoded-transform.idl index 2ceb9355b02af12..2d65b04e2fdec52 100644 --- a/interfaces/webrtc-encoded-transform.idl +++ b/interfaces/webrtc-encoded-transform.idl @@ -36,9 +36,31 @@ typedef (SmallCryptoKeyID or bigint) CryptoKeyID; interface SFrameTransform { constructor(optional SFrameTransformOptions options = {}); Promise setEncryptionKey(CryptoKey key, optional CryptoKeyID keyID); + attribute EventHandler onerror; }; SFrameTransform includes GenericTransformStream; +enum SFrameTransformErrorEventType { + "authentication", + "keyID", + "syntax" +}; + +[Exposed=(Window,DedicatedWorker)] +interface SFrameTransformErrorEvent : Event { + constructor(DOMString type, SFrameTransformErrorEventInit eventInitDict); + + readonly attribute SFrameTransformErrorEventType type; + readonly attribute CryptoKeyID? keyID; + readonly attribute any frame; +}; + +dictionary SFrameTransformErrorEventInit : EventInit { + required SFrameTransformErrorEventType type; + required any frame; + CryptoKeyID? keyID; +}; + // New enum for video frame types. Will eventually re-use the equivalent defined // by WebCodecs. enum RTCEncodedVideoFrameType { diff --git a/interfaces/webtransport.idl b/interfaces/webtransport.idl index 6c3df2abc52cc97..7e91cf21d3be815 100644 --- a/interfaces/webtransport.idl +++ b/interfaces/webtransport.idl @@ -3,31 +3,25 @@ // (https://github.com/w3c/webref) // Source: WebTransport (https://w3c.github.io/webtransport/) -interface mixin UnidirectionalStreamsTransport { - Promise createUnidirectionalStream(optional SendStreamParameters parameters = {}); - /* a ReadableStream of ReceiveStream objects */ - readonly attribute ReadableStream incomingUnidirectionalStreams; -}; - -dictionary SendStreamParameters { -}; - -[Exposed=(Window,Worker)] +[Exposed=(Window,Worker), SecureContext] interface DatagramDuplexStream { readonly attribute ReadableStream readable; readonly attribute WritableStream writable; + + attribute double? incomingMaxAge; + attribute double? outgoingMaxAge; + attribute long incomingHighWaterMark; + attribute long outgoingHighWaterMark; }; -[Exposed=(Window,Worker)] +[Exposed=(Window,Worker), SecureContext] interface WebTransport { constructor(USVString url, optional WebTransportOptions options = {}); Promise getStats(); - readonly attribute WebTransportState state; readonly attribute Promise ready; readonly attribute Promise closed; undefined close(optional WebTransportCloseInfo closeInfo = {}); - attribute EventHandler onstatechange; readonly attribute unsigned short maxDatagramSize; readonly attribute DatagramDuplexStream datagrams; @@ -35,22 +29,17 @@ interface WebTransport { Promise createBidirectionalStream(); /* a ReadableStream of BidirectionalStream objects */ readonly attribute ReadableStream incomingBidirectionalStreams; -}; -WebTransport includes UnidirectionalStreamsTransport; + Promise createUnidirectionalStream(); + /* a ReadableStream of ReceiveStream objects */ + readonly attribute ReadableStream incomingUnidirectionalStreams; +}; dictionary WebTransportOptions { boolean allowPooling; sequence serverCertificateFingerprints; }; -enum WebTransportState { - "connecting", - "connected", - "closed", - "failed" -}; - dictionary WebTransportCloseInfo { unsigned long long errorCode = 0; DOMString reason = ""; @@ -68,23 +57,19 @@ dictionary WebTransportStats { unsigned long numReceivedDatagramsDropped; }; -[ Exposed=(Window,Worker) ] +[Exposed=(Window,Worker), SecureContext] interface SendStream : WritableStream /* of Uint8Array */ { - readonly attribute Promise writingAborted; - undefined abortWriting(optional StreamAbortInfo abortInfo = {}); }; dictionary StreamAbortInfo { [EnforceRange] octet errorCode = 0; }; -[ Exposed=(Window,Worker) ] +[Exposed=(Window,Worker), SecureContext] interface ReceiveStream : ReadableStream /* of Uint8Array */ { - readonly attribute Promise readingAborted; - undefined abortReading(optional StreamAbortInfo abortInfo = {}); }; -[ Exposed=(Window,Worker) ] +[Exposed=(Window,Worker), SecureContext] interface BidirectionalStream { readonly attribute ReceiveStream readable; readonly attribute SendStream writable;