Skip to content

Commit 17da3fe

Browse files
saschanazsandersn
authored andcommitted
General type updates (#712)
* General type updates * removeTypes cleanup * remove redundant addedTypes
1 parent f26a185 commit 17da3fe

17 files changed

+112
-182
lines changed

baselines/dom.generated.d.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ interface IIRFilterOptions extends AudioNodeOptions {
580580
feedforward: number[];
581581
}
582582

583+
interface ImageBitmapRenderingContextSettings {
584+
alpha?: boolean;
585+
}
586+
583587
interface ImageEncodeOptions {
584588
quality?: number;
585589
type?: string;
@@ -731,7 +735,6 @@ interface MediaTrackCapabilities {
731735
resizeMode?: string[];
732736
sampleRate?: ULongRange;
733737
sampleSize?: ULongRange;
734-
volume?: DoubleRange;
735738
width?: ULongRange;
736739
}
737740

@@ -750,7 +753,6 @@ interface MediaTrackConstraintSet {
750753
resizeMode?: ConstrainDOMString;
751754
sampleRate?: ConstrainULong;
752755
sampleSize?: ConstrainULong;
753-
volume?: ConstrainDouble;
754756
width?: ConstrainULong;
755757
}
756758

@@ -773,7 +775,6 @@ interface MediaTrackSettings {
773775
resizeMode?: string;
774776
sampleRate?: number;
775777
sampleSize?: number;
776-
volume?: number;
777778
width?: number;
778779
}
779780

@@ -792,7 +793,6 @@ interface MediaTrackSupportedConstraints {
792793
resizeMode?: boolean;
793794
sampleRate?: boolean;
794795
sampleSize?: boolean;
795-
volume?: boolean;
796796
width?: boolean;
797797
}
798798

@@ -3421,7 +3421,6 @@ interface CanvasRect {
34213421
/** 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. */
34223422
interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath {
34233423
readonly canvas: HTMLCanvasElement;
3424-
getContextAttributes(): CanvasRenderingContext2DSettings;
34253424
}
34263425

34273426
declare var CanvasRenderingContext2D: {
@@ -5368,7 +5367,7 @@ interface Event {
53685367
*/
53695368
readonly type: string;
53705369
/**
5371-
* 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.
5370+
* 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.
53725371
*/
53735372
composedPath(): EventTarget[];
53745373
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
@@ -6460,9 +6459,11 @@ interface HTMLCanvasElement extends HTMLElement {
64606459
* 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.
64616460
* @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");
64626461
*/
6463-
getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
6464-
getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
6465-
getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
6462+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
6463+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
6464+
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
6465+
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
6466+
getContext(contextId: string, options?: any): RenderingContext | null;
64666467
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
64676468
/**
64686469
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
@@ -7961,7 +7962,6 @@ interface HTMLObjectElement extends HTMLElement {
79617962
* Sets or retrieves the MIME type of the object.
79627963
*/
79637964
type: string;
7964-
typeMustMatch: boolean;
79657965
/**
79667966
* Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
79677967
*/
@@ -9696,7 +9696,7 @@ interface ImageBitmapRenderingContext {
96969696
/**
96979697
* Returns the canvas element that the context is bound to.
96989698
*/
9699-
readonly canvas: HTMLCanvasElement;
9699+
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
97009700
/**
97019701
* Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
97029702
*/
@@ -10497,7 +10497,6 @@ interface MediaStreamTrackEventMap {
1049710497
"ended": Event;
1049810498
"isolationchange": Event;
1049910499
"mute": Event;
10500-
"overconstrained": MediaStreamErrorEvent;
1050110500
"unmute": Event;
1050210501
}
1050310502

@@ -10512,7 +10511,6 @@ interface MediaStreamTrack extends EventTarget {
1051210511
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
1051310512
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
1051410513
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
10515-
onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;
1051610514
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
1051710515
readonly readyState: MediaStreamTrackState;
1051810516
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
@@ -11326,12 +11324,16 @@ interface OffscreenCanvas extends EventTarget {
1132611324
*/
1132711325
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
1132811326
/**
11329-
* 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.
11327+
* 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.
1133011328
*
1133111329
* 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]
1133211330
*
1133311331
* 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).
1133411332
*/
11333+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
11334+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
11335+
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
11336+
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
1133511337
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
1133611338
/**
1133711339
* 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.
@@ -19894,7 +19896,7 @@ type DOMHighResTimeStamp = number;
1989419896
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1989519897
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
1989619898
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
19897-
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext;
19899+
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1989819900
type MessageEventSource = WindowProxy | MessagePort | ServiceWorker;
1989919901
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
1990019902
type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
@@ -20008,7 +20010,7 @@ type NavigationReason = "up" | "down" | "left" | "right";
2000820010
type NavigationType = "navigate" | "reload" | "back_forward" | "prerender";
2000920011
type NotificationDirection = "auto" | "ltr" | "rtl";
2001020012
type NotificationPermission = "default" | "denied" | "granted";
20011-
type OffscreenRenderingContextId = "2d" | "webgl" | "webgl2";
20013+
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
2001220014
type OrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
2001320015
type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
2001420016
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/addedTypes.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,16 +2148,6 @@
21482148
]
21492149
}
21502150
},
2151-
"MediaStreamTrack": {
2152-
"events": {
2153-
"event": [
2154-
{
2155-
"name": "overconstrained",
2156-
"type": "MediaStreamErrorEvent"
2157-
}
2158-
]
2159-
}
2160-
},
21612151
"OverconstrainedError": {
21622152
"name": "OverconstrainedError",
21632153
"extends": "Error",
@@ -2190,30 +2180,6 @@
21902180
},
21912181
"dictionaries": {
21922182
"dictionary": {
2193-
"WebGLContextAttributes": {
2194-
"name": "WebGLContextAttributes",
2195-
"members": {
2196-
"member": {
2197-
"failIfMajorPerformanceCaveat": {
2198-
"name": "failIfMajorPerformanceCaveat",
2199-
"override-type": "boolean",
2200-
"required": 0
2201-
}
2202-
}
2203-
}
2204-
},
2205-
"EventInit": {
2206-
"name": "EventInit",
2207-
"members": {
2208-
"member": {
2209-
"composed": {
2210-
"name": "composed",
2211-
"override-type": "boolean",
2212-
"required": 0
2213-
}
2214-
}
2215-
}
2216-
},
22172183
"ShadowRootInit": {
22182184
"members": {
22192185
"member": {

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.",

0 commit comments

Comments
 (0)