Skip to content

Commit c8eda24

Browse files
committed
General type updates
1 parent 10a86a2 commit c8eda24

15 files changed

+102
-61
lines changed

baselines/dom.generated.d.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ interface IIRFilterOptions extends AudioNodeOptions {
550550
feedforward: number[];
551551
}
552552

553+
interface ImageBitmapRenderingContextSettings {
554+
alpha?: boolean;
555+
}
556+
553557
interface ImageEncodeOptions {
554558
quality?: number;
555559
type?: string;
@@ -701,7 +705,6 @@ interface MediaTrackCapabilities {
701705
resizeMode?: string[];
702706
sampleRate?: ULongRange;
703707
sampleSize?: ULongRange;
704-
volume?: DoubleRange;
705708
width?: ULongRange;
706709
}
707710

@@ -720,7 +723,6 @@ interface MediaTrackConstraintSet {
720723
resizeMode?: ConstrainDOMString;
721724
sampleRate?: ConstrainULong;
722725
sampleSize?: ConstrainULong;
723-
volume?: ConstrainDouble;
724726
width?: ConstrainULong;
725727
}
726728

@@ -743,7 +745,6 @@ interface MediaTrackSettings {
743745
resizeMode?: string;
744746
sampleRate?: number;
745747
sampleSize?: number;
746-
volume?: number;
747748
width?: number;
748749
}
749750

@@ -762,7 +763,6 @@ interface MediaTrackSupportedConstraints {
762763
resizeMode?: boolean;
763764
sampleRate?: boolean;
764765
sampleSize?: boolean;
765-
volume?: boolean;
766766
width?: boolean;
767767
}
768768

@@ -3311,7 +3311,6 @@ interface CanvasRect {
33113311
/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. */
33123312
interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath {
33133313
readonly canvas: HTMLCanvasElement;
3314-
getContextAttributes(): CanvasRenderingContext2DSettings;
33153314
}
33163315

33173316
declare var CanvasRenderingContext2D: {
@@ -5258,7 +5257,7 @@ interface Event {
52585257
*/
52595258
readonly type: string;
52605259
/**
5261-
* Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
5260+
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
52625261
*/
52635262
composedPath(): EventTarget[];
52645263
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
@@ -6350,9 +6349,11 @@ interface HTMLCanvasElement extends HTMLElement {
63506349
* Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
63516350
* @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
63526351
*/
6353-
getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
6354-
getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
6355-
getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
6352+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
6353+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
6354+
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
6355+
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
6356+
getContext(contextId: string, options?: any): RenderingContext | null;
63566357
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
63576358
/**
63586359
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
@@ -7851,7 +7852,6 @@ interface HTMLObjectElement extends HTMLElement {
78517852
* Sets or retrieves the MIME type of the object.
78527853
*/
78537854
type: string;
7854-
typeMustMatch: boolean;
78557855
/**
78567856
* Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
78577857
*/
@@ -9586,7 +9586,7 @@ interface ImageBitmapRenderingContext {
95869586
/**
95879587
* Returns the canvas element that the context is bound to.
95889588
*/
9589-
readonly canvas: HTMLCanvasElement;
9589+
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
95909590
/**
95919591
* Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
95929592
*/
@@ -10387,7 +10387,6 @@ interface MediaStreamTrackEventMap {
1038710387
"ended": Event;
1038810388
"isolationchange": Event;
1038910389
"mute": Event;
10390-
"overconstrained": MediaStreamErrorEvent;
1039110390
"unmute": Event;
1039210391
}
1039310392

@@ -10402,7 +10401,6 @@ interface MediaStreamTrack extends EventTarget {
1040210401
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
1040310402
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
1040410403
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
10405-
onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;
1040610404
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
1040710405
readonly readyState: MediaStreamTrackState;
1040810406
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
@@ -11216,12 +11214,16 @@ interface OffscreenCanvas extends EventTarget {
1121611214
*/
1121711215
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
1121811216
/**
11219-
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "webgl", or "webgl2". options is handled by that API.
11217+
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
1122011218
*
1122111219
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
1122211220
*
1122311221
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
1122411222
*/
11223+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
11224+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
11225+
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
11226+
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
1122511227
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
1122611228
/**
1122711229
* Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.
@@ -19772,7 +19774,7 @@ type DOMHighResTimeStamp = number;
1977219774
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1977319775
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
1977419776
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
19775-
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext;
19777+
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1977619778
type MessageEventSource = WindowProxy | MessagePort | ServiceWorker;
1977719779
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
1977819780
type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
@@ -19877,7 +19879,7 @@ type NavigationReason = "up" | "down" | "left" | "right";
1987719879
type NavigationType = "navigate" | "reload" | "back_forward" | "prerender";
1987819880
type NotificationDirection = "auto" | "ltr" | "rtl";
1987919881
type NotificationPermission = "default" | "denied" | "granted";
19880-
type OffscreenRenderingContextId = "2d" | "webgl" | "webgl2";
19882+
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
1988119883
type OrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
1988219884
type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
1988319885
type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom";

baselines/webworker.generated.d.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ interface CacheQueryOptions {
4949
ignoreVary?: boolean;
5050
}
5151

52+
interface CanvasRenderingContext2DSettings {
53+
alpha?: boolean;
54+
desynchronized?: boolean;
55+
}
56+
5257
interface ClientQueryOptions {
5358
includeUncontrolled?: boolean;
5459
type?: ClientTypes;
@@ -214,6 +219,10 @@ interface IDBVersionChangeEventInit extends EventInit {
214219
oldVersion?: number;
215220
}
216221

222+
interface ImageBitmapRenderingContextSettings {
223+
alpha?: boolean;
224+
}
225+
217226
interface ImageEncodeOptions {
218227
quality?: number;
219228
type?: string;
@@ -1359,7 +1368,7 @@ interface Event {
13591368
*/
13601369
readonly type: string;
13611370
/**
1362-
* Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
1371+
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
13631372
*/
13641373
composedPath(): EventTarget[];
13651374
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
@@ -2162,6 +2171,22 @@ interface ImageBitmapOptions {
21622171
resizeWidth?: number;
21632172
}
21642173

2174+
interface ImageBitmapRenderingContext {
2175+
/**
2176+
* Returns the canvas element that the context is bound to.
2177+
*/
2178+
readonly canvas: OffscreenCanvas;
2179+
/**
2180+
* Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
2181+
*/
2182+
transferFromImageBitmap(bitmap: ImageBitmap | null): void;
2183+
}
2184+
2185+
declare var ImageBitmapRenderingContext: {
2186+
prototype: ImageBitmapRenderingContext;
2187+
new(): ImageBitmapRenderingContext;
2188+
};
2189+
21652190
/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
21662191
interface ImageData {
21672192
/**
@@ -2412,12 +2437,16 @@ interface OffscreenCanvas extends EventTarget {
24122437
*/
24132438
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
24142439
/**
2415-
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "webgl", or "webgl2". options is handled by that API.
2440+
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
24162441
*
24172442
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
24182443
*
24192444
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
24202445
*/
2446+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
2447+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
2448+
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
2449+
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
24212450
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
24222451
/**
24232452
* Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.
@@ -5767,7 +5796,7 @@ type RequestInfo = Request | string;
57675796
type BlobPart = BufferSource | Blob | string;
57685797
type DOMHighResTimeStamp = number;
57695798
type CanvasImageSource = ImageBitmap | OffscreenCanvas;
5770-
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext;
5799+
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
57715800
type MessageEventSource = MessagePort | ServiceWorker;
57725801
type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
57735802
type TimerHandler = string | Function;
@@ -5818,7 +5847,7 @@ type KeyType = "public" | "private" | "secret";
58185847
type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey";
58195848
type NotificationDirection = "auto" | "ltr" | "rtl";
58205849
type NotificationPermission = "default" | "denied" | "granted";
5821-
type OffscreenRenderingContextId = "2d" | "webgl" | "webgl2";
5850+
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
58225851
type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camera" | "microphone" | "speaker" | "device-info" | "background-sync" | "bluetooth" | "persistent-storage" | "ambient-light-sensor" | "accelerometer" | "gyroscope" | "magnetometer" | "clipboard";
58235852
type PermissionState = "granted" | "denied" | "prompt";
58245853
type PushEncryptionKeyName = "p256dh" | "auth";

inputfiles/idl/DOM XPath.widl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ callback interface XPathNSResolver {
3535
};
3636

3737
interface mixin XPathEvaluatorBase {
38-
XPathExpression createExpression(DOMString expression,
39-
optional XPathNSResolver? resolver);
38+
[NewObject] XPathExpression createExpression(DOMString expression,
39+
optional XPathNSResolver? resolver);
4040
XPathNSResolver createNSResolver(Node nodeResolver);
41-
XPathResult evaluate(DOMString expression,
42-
Node contextNode,
43-
optional XPathNSResolver? resolver,
44-
optional unsigned short type,
41+
XPathResult evaluate(DOMString expression,
42+
Node contextNode,
43+
optional XPathNSResolver? resolver,
44+
optional unsigned short type,
4545
optional XPathResult? result);
4646
};
4747

inputfiles/idl/DOM.commentmap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"event-type": "Returns the type of event, e.g. \"click\", \"hashchange\", or \"submit\".",
44
"event-target": "Returns the object to which event is dispatched (its target).",
55
"event-currenttarget": "Returns the object whose event listener's callback is currently being invoked.",
6-
"event-composedpath": "Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \"closed\" that are not reachable from event's currentTarget.",
6+
"event-composedpath": "Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \"closed\" that are not reachable from event's currentTarget.",
77
"event-eventphase": "Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.",
88
"event-stoppropagation": "When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.",
99
"event-stopimmediatepropagation": "Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.",

inputfiles/idl/HTML - Canvas.commentmap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"imagebitmaprenderingcontext-canvas": "Returns the canvas element that the context is bound to.",
2828
"imagebitmaprenderingcontext-transferfromimagebitmap": "Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.",
2929
"offscreencanvas": "Returns a new OffscreenCanvas object that is not linked to a placeholder canvas element, and whose bitmap's size is determined by the width and height arguments.",
30-
"offscreencanvas-getcontext": "Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: \"2d\", \"webgl\", or \"webgl2\". options is handled by that API.\n\nThis specification defines the \"2d\" context below, which is similar but distinct from the \"2d\" context that is created from a canvas element. The WebGL specifications define the \"webgl\" and \"webgl2\" contexts. [WEBGL]\n\nReturns null if the canvas has already been initialized with another context type (e.g., trying to get a \"2d\" context after getting a \"webgl\" context).",
30+
"offscreencanvas-getcontext": "Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: \"2d\", \"bitmaprenderer\", \"webgl\", or \"webgl2\". options is handled by that API.\n\nThis specification defines the \"2d\" context below, which is similar but distinct from the \"2d\" context that is created from a canvas element. The WebGL specifications define the \"webgl\" and \"webgl2\" contexts. [WEBGL]\n\nReturns null if the canvas has already been initialized with another context type (e.g., trying to get a \"2d\" context after getting a \"webgl\" context).",
3131
"offscreencanvas-width": "These attributes return the dimensions of the OffscreenCanvas object's bitmap.\n\nThey can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).",
3232
"offscreencanvas-height": "These attributes return the dimensions of the OffscreenCanvas object's bitmap.\n\nThey can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).",
3333
"offscreencanvas-converttoblob": "Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.\n\nThe argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of \"image/png\"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as \"image/jpeg\"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.",

0 commit comments

Comments
 (0)