From 2fa17c482e05edcdb98368c8cd6374720e2842f1 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:59:21 +0100 Subject: [PATCH 01/20] Remove unimplemented WindowClient#ancestorOrigins --- baselines/webworker.generated.d.ts | 1 - inputfiles/removedTypes.json | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 09689a946..3d1b95937 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -5363,7 +5363,6 @@ declare var WebSocket: { /** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */ interface WindowClient extends Client { - readonly ancestorOrigins: ReadonlyArray; readonly focused: boolean; readonly visibilityState: VisibilityState; focus(): Promise; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index e9ff57fb0..a5d197e6b 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -397,6 +397,13 @@ "WindowConsole" ] }, + "WindowClient": { + "properties": { + "property": { + "ancestorOrigins": null + } + } + }, "WritableStream": { "methods": { "method": { From 3be21259d8e0e335d2f44b38608b03ed24b257c5 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:53:54 +0100 Subject: [PATCH 02/20] Remove unimplemented WorkerNavigator#serviceWorker --- baselines/webworker.generated.d.ts | 1 - inputfiles/removedTypes.json | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 3d1b95937..07f267ebf 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -5485,7 +5485,6 @@ declare var WorkerLocation: { /** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */ interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorStorage { readonly permissions: Permissions; - readonly serviceWorker: ServiceWorkerContainer; } declare var WorkerNavigator: { diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index a5d197e6b..6fe9f127a 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -404,6 +404,13 @@ } } }, + "WorkerNavigator": { + "properties": { + "property": { + "serviceWorker": null + } + } + }, "WritableStream": { "methods": { "method": { From 8f0c6afda60a1c058183c1f2ebb0e73a72494505 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:44:20 +0100 Subject: [PATCH 03/20] Remove unimplemented PushSubscriptionChangeEvent --- baselines/webworker.generated.d.ts | 17 ----------------- inputfiles/removedTypes.json | 8 ++++++++ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 07f267ebf..0a40b57b4 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -362,11 +362,6 @@ interface PushPermissionDescriptor extends PermissionDescriptor { userVisibleOnly?: boolean; } -interface PushSubscriptionChangeEventInit extends ExtendableEventInit { - newSubscription?: PushSubscription; - oldSubscription?: PushSubscription; -} - interface PushSubscriptionJSON { endpoint?: string; expirationTime?: number | null; @@ -2702,16 +2697,6 @@ declare var PushSubscription: { new(): PushSubscription; }; -interface PushSubscriptionChangeEvent extends ExtendableEvent { - readonly newSubscription: PushSubscription | null; - readonly oldSubscription: PushSubscription | null; -} - -declare var PushSubscriptionChangeEvent: { - prototype: PushSubscriptionChangeEvent; - new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent; -}; - interface PushSubscriptionOptions { readonly applicationServerKey: ArrayBuffer | null; readonly userVisibleOnly: boolean; @@ -2913,7 +2898,6 @@ interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { "notificationclick": NotificationEvent; "notificationclose": NotificationEvent; "push": PushEvent; - "pushsubscriptionchange": PushSubscriptionChangeEvent; "sync": SyncEvent; } @@ -2928,7 +2912,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope { onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null; onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null; onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null; - onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null; onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null; readonly registration: ServiceWorkerRegistration; readonly serviceWorker: ServiceWorker; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 6fe9f127a..c32c3d884 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -248,6 +248,7 @@ "PasswordCredential": null, "Position": null, "PositionError": null, + "PushSubscriptionChangeEvent": null, "ReadableByteStreamController": null, "ReadableStream": { "iterator": null @@ -284,6 +285,13 @@ } } }, + "ServiceWorkerGlobalScope": { + "properties": { + "property": { + "onpushsubscriptionchange": null + } + } + }, "ShadowRoot": { "properties": { "property": { From 7aa27a8729e3cb474ab317a1037f583ae35879c7 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:34:26 +0100 Subject: [PATCH 04/20] Remove unimplemented WebGLObject --- baselines/dom.generated.d.ts | 32 ++++++++++---------------- baselines/webworker.generated.d.ts | 32 ++++++++++---------------- inputfiles/removedTypes.json | 37 ++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 40 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index def48d12b..2eb1377c0 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -17422,7 +17422,7 @@ declare var WebGLActiveInfo: { }; /** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */ -interface WebGLBuffer extends WebGLObject { +interface WebGLBuffer { } declare var WebGLBuffer: { @@ -17441,7 +17441,7 @@ declare var WebGLContextEvent: { }; /** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */ -interface WebGLFramebuffer extends WebGLObject { +interface WebGLFramebuffer { } declare var WebGLFramebuffer: { @@ -17449,16 +17449,8 @@ declare var WebGLFramebuffer: { new(): WebGLFramebuffer; }; -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -}; - /** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */ -interface WebGLProgram extends WebGLObject { +interface WebGLProgram { } declare var WebGLProgram: { @@ -17466,7 +17458,7 @@ declare var WebGLProgram: { new(): WebGLProgram; }; -interface WebGLQuery extends WebGLObject { +interface WebGLQuery { } declare var WebGLQuery: { @@ -17475,7 +17467,7 @@ declare var WebGLQuery: { }; /** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */ -interface WebGLRenderbuffer extends WebGLObject { +interface WebGLRenderbuffer { } declare var WebGLRenderbuffer: { @@ -18254,7 +18246,7 @@ interface WebGLRenderingContextOverloads { uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void; } -interface WebGLSampler extends WebGLObject { +interface WebGLSampler { } declare var WebGLSampler: { @@ -18263,7 +18255,7 @@ declare var WebGLSampler: { }; /** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */ -interface WebGLShader extends WebGLObject { +interface WebGLShader { } declare var WebGLShader: { @@ -18283,7 +18275,7 @@ declare var WebGLShaderPrecisionFormat: { new(): WebGLShaderPrecisionFormat; }; -interface WebGLSync extends WebGLObject { +interface WebGLSync { } declare var WebGLSync: { @@ -18292,7 +18284,7 @@ declare var WebGLSync: { }; /** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */ -interface WebGLTexture extends WebGLObject { +interface WebGLTexture { } declare var WebGLTexture: { @@ -18300,7 +18292,7 @@ declare var WebGLTexture: { new(): WebGLTexture; }; -interface WebGLTransformFeedback extends WebGLObject { +interface WebGLTransformFeedback { } declare var WebGLTransformFeedback: { @@ -18317,7 +18309,7 @@ declare var WebGLUniformLocation: { new(): WebGLUniformLocation; }; -interface WebGLVertexArrayObject extends WebGLObject { +interface WebGLVertexArrayObject { } declare var WebGLVertexArrayObject: { @@ -18325,7 +18317,7 @@ declare var WebGLVertexArrayObject: { new(): WebGLVertexArrayObject; }; -interface WebGLVertexArrayObjectOES extends WebGLObject { +interface WebGLVertexArrayObjectOES { } interface WebKitPoint { diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 0a40b57b4..42ea2165d 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -4370,7 +4370,7 @@ declare var WebGLActiveInfo: { }; /** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */ -interface WebGLBuffer extends WebGLObject { +interface WebGLBuffer { } declare var WebGLBuffer: { @@ -4389,7 +4389,7 @@ declare var WebGLContextEvent: { }; /** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */ -interface WebGLFramebuffer extends WebGLObject { +interface WebGLFramebuffer { } declare var WebGLFramebuffer: { @@ -4397,16 +4397,8 @@ declare var WebGLFramebuffer: { new(): WebGLFramebuffer; }; -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -}; - /** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */ -interface WebGLProgram extends WebGLObject { +interface WebGLProgram { } declare var WebGLProgram: { @@ -4414,7 +4406,7 @@ declare var WebGLProgram: { new(): WebGLProgram; }; -interface WebGLQuery extends WebGLObject { +interface WebGLQuery { } declare var WebGLQuery: { @@ -4423,7 +4415,7 @@ declare var WebGLQuery: { }; /** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */ -interface WebGLRenderbuffer extends WebGLObject { +interface WebGLRenderbuffer { } declare var WebGLRenderbuffer: { @@ -5202,7 +5194,7 @@ interface WebGLRenderingContextOverloads { uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void; } -interface WebGLSampler extends WebGLObject { +interface WebGLSampler { } declare var WebGLSampler: { @@ -5211,7 +5203,7 @@ declare var WebGLSampler: { }; /** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */ -interface WebGLShader extends WebGLObject { +interface WebGLShader { } declare var WebGLShader: { @@ -5231,7 +5223,7 @@ declare var WebGLShaderPrecisionFormat: { new(): WebGLShaderPrecisionFormat; }; -interface WebGLSync extends WebGLObject { +interface WebGLSync { } declare var WebGLSync: { @@ -5240,7 +5232,7 @@ declare var WebGLSync: { }; /** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */ -interface WebGLTexture extends WebGLObject { +interface WebGLTexture { } declare var WebGLTexture: { @@ -5248,7 +5240,7 @@ declare var WebGLTexture: { new(): WebGLTexture; }; -interface WebGLTransformFeedback extends WebGLObject { +interface WebGLTransformFeedback { } declare var WebGLTransformFeedback: { @@ -5265,7 +5257,7 @@ declare var WebGLUniformLocation: { new(): WebGLUniformLocation; }; -interface WebGLVertexArrayObject extends WebGLObject { +interface WebGLVertexArrayObject { } declare var WebGLVertexArrayObject: { @@ -5273,7 +5265,7 @@ declare var WebGLVertexArrayObject: { new(): WebGLVertexArrayObject; }; -interface WebGLVertexArrayObjectOES extends WebGLObject { +interface WebGLVertexArrayObjectOES { } interface WebSocketEventMap { diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index c32c3d884..0249c2ae4 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -370,6 +370,43 @@ } }, "VideoTrackList": null, + "WebGLBuffer": { + "extends": null + }, + "WebGLFramebuffer": { + "extends": null + }, + "WebGLObject": null, + "WebGLProgram": { + "extends": null + }, + "WebGLQuery": { + "extends": null + }, + "WebGLRenderbuffer": { + "extends": null + }, + "WebGLSampler": { + "extends": null + }, + "WebGLShader": { + "extends": null + }, + "WebGLSync": { + "extends": null + }, + "WebGLTexture": { + "extends": null + }, + "WebGLTransformFeedback": { + "extends": null + }, + "WebGLVertexArrayObject": { + "extends": null + }, + "WebGLVertexArrayObjectOES": { + "extends": null + }, "WebKitCSSMatrix": null, "WebKitDirectoryEntry": null, "WebKitDirectoryReader": null, From 0e862e6bdccd906f80c75a8ef16b69069d659c6a Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:25:14 +0100 Subject: [PATCH 05/20] Remove unimplemented WebVR APIs --- baselines/dom.generated.d.ts | 10 ---------- inputfiles/removedTypes.json | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 2eb1377c0..ffd5262b4 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -16196,7 +16196,6 @@ interface VRPose { readonly linearVelocity: Float32Array | null; readonly orientation: Float32Array | null; readonly position: Float32Array | null; - readonly timestamp: number; } declare var VRPose: { @@ -18512,9 +18511,6 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler "vrdisplayconnect": Event; "vrdisplaydeactivate": Event; "vrdisplaydisconnect": Event; - "vrdisplayfocus": Event; - "vrdisplaypointerrestricted": Event; - "vrdisplaypointerunrestricted": Event; "vrdisplaypresentchange": Event; "waiting": Event; } @@ -18577,9 +18573,6 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler onvrdisplayconnect: ((this: Window, ev: Event) => any) | null; onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null; onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null; - onvrdisplayfocus: ((this: Window, ev: Event) => any) | null; - onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; - onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; opener: any; /** @deprecated */ @@ -19627,9 +19620,6 @@ declare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null; declare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null; -declare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null; -declare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; -declare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; declare var opener: any; /** @deprecated */ diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 0249c2ae4..a99634e35 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -370,6 +370,13 @@ } }, "VideoTrackList": null, + "VRPose": { + "properties": { + "property": { + "timestamp": null + } + } + }, "WebGLBuffer": { "extends": null }, @@ -425,6 +432,9 @@ "ontouchend": null, "ontouchmove": null, "ontouchstart": null, + "onvrdisplayfocus": null, + "onvrdisplaypointerrestricted": null, + "onvrdisplaypointerunrestricted": null, "performance": null } }, From f49723d197ea56da91fe73d087739b5025aba694 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:17:05 +0100 Subject: [PATCH 06/20] Remove unimplemented TextTrack#sourceBuffer --- baselines/dom.generated.d.ts | 1 - inputfiles/removedTypes.json | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ffd5262b4..26d8a5ae5 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -15758,7 +15758,6 @@ interface TextTrack extends EventTarget { */ mode: TextTrackMode; oncuechange: ((this: TextTrack, ev: Event) => any) | null; - readonly sourceBuffer: SourceBuffer | null; /** * Adds the given cue to textTrack's text track list of cues. */ diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index a99634e35..60b32f482 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -369,6 +369,13 @@ } } }, + "TextTrack": { + "properties": { + "property": { + "sourceBuffer": null + } + } + }, "VideoTrackList": null, "VRPose": { "properties": { From 625b06662c3b2538b6de2f810fa1d298c514f639 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 03:02:06 +0100 Subject: [PATCH 07/20] Remove unexposed TextMetrics APIs --- baselines/dom.generated.d.ts | 28 ---------------------------- baselines/webworker.generated.d.ts | 28 ---------------------------- inputfiles/removedTypes.json | 13 +++++++++++++ 3 files changed, 13 insertions(+), 56 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 26d8a5ae5..34e8bf356 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -15674,34 +15674,6 @@ interface TextMetrics { * Returns the measurement described below. */ readonly actualBoundingBoxRight: number; - /** - * Returns the measurement described below. - */ - readonly alphabeticBaseline: number; - /** - * Returns the measurement described below. - */ - readonly emHeightAscent: number; - /** - * Returns the measurement described below. - */ - readonly emHeightDescent: number; - /** - * Returns the measurement described below. - */ - readonly fontBoundingBoxAscent: number; - /** - * Returns the measurement described below. - */ - readonly fontBoundingBoxDescent: number; - /** - * Returns the measurement described below. - */ - readonly hangingBaseline: number; - /** - * Returns the measurement described below. - */ - readonly ideographicBaseline: number; /** * Returns the measurement described below. */ diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 42ea2165d..ecbb0eb5a 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -3157,34 +3157,6 @@ interface TextMetrics { * Returns the measurement described below. */ readonly actualBoundingBoxRight: number; - /** - * Returns the measurement described below. - */ - readonly alphabeticBaseline: number; - /** - * Returns the measurement described below. - */ - readonly emHeightAscent: number; - /** - * Returns the measurement described below. - */ - readonly emHeightDescent: number; - /** - * Returns the measurement described below. - */ - readonly fontBoundingBoxAscent: number; - /** - * Returns the measurement described below. - */ - readonly fontBoundingBoxDescent: number; - /** - * Returns the measurement described below. - */ - readonly hangingBaseline: number; - /** - * Returns the measurement described below. - */ - readonly ideographicBaseline: number; /** * Returns the measurement described below. */ diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 60b32f482..21a3231d4 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -369,6 +369,19 @@ } } }, + "TextMetrics": { + "properties": { + "property": { + "alphabeticBaseline": null, + "emHeightAscent": null, + "emHeightDescent": null, + "fontBoundingBoxAscent": null, + "fontBoundingBoxDescent": null, + "hangingBaseline": null, + "ideographicBaseline": null + } + } + }, "TextTrack": { "properties": { "property": { From 6ac9b3173d118961908c59ea71e9cb97a473bc50 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 02:56:22 +0100 Subject: [PATCH 08/20] Remove unimplemented SVGUseElement properties --- baselines/dom.generated.d.ts | 10 ++-------- inputfiles/removedTypes.json | 9 +++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 34e8bf356..38c112405 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -14754,9 +14754,7 @@ declare var SVGUnitTypes: { /** Corresponds to the element. */ interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { - readonly animatedInstanceRoot: SVGElementInstance | null; readonly height: SVGAnimatedLength; - readonly instanceRoot: SVGElementInstance | null; readonly width: SVGAnimatedLength; readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; @@ -14789,16 +14787,12 @@ declare var SVGViewElement: { readonly SVG_ZOOMANDPAN_UNKNOWN: number; }; -/** Used to reflect the zoomAndPan attribute, and is mixed in to other interfaces for elements that support this attribute. */ interface SVGZoomAndPan { - readonly zoomAndPan: number; -} - -declare var SVGZoomAndPan: { + zoomAndPan: number; readonly SVG_ZOOMANDPAN_DISABLE: number; readonly SVG_ZOOMANDPAN_MAGNIFY: number; readonly SVG_ZOOMANDPAN_UNKNOWN: number; -}; +} interface SVGZoomEvent extends UIEvent { readonly newScale: number; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 21a3231d4..e3982e564 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -369,6 +369,15 @@ } } }, + "SVGUseElement": { + "properties": { + "property": { + "animatedInstanceRoot": null, + "instanceRoot": null + } + } + }, + "SVGZoomAndPan": null, "TextMetrics": { "properties": { "property": { From 3f6baa47cc271a69fedad1c5201e07800a9a4e03 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 02:06:14 +0100 Subject: [PATCH 09/20] Update WebRTC types --- baselines/dom.generated.d.ts | 79 +++++------------- inputfiles/idl/WebRTC.widl | 138 ++++++++++---------------------- inputfiles/overridingTypes.json | 4 - inputfiles/removedTypes.json | 15 +++- 4 files changed, 72 insertions(+), 164 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 38c112405..524d5f13d 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1164,12 +1164,11 @@ interface RTCConfiguration { iceCandidatePoolSize?: number; iceServers?: RTCIceServer[]; iceTransportPolicy?: RTCIceTransportPolicy; - peerIdentity?: string; rtcpMuxPolicy?: RTCRtcpMuxPolicy; } interface RTCDTMFToneChangeEventInit extends EventInit { - tone: string; + tone?: string; } interface RTCDataChannelEventInit extends EventInit { @@ -1182,7 +1181,6 @@ interface RTCDataChannelInit { maxRetransmits?: number; negotiated?: boolean; ordered?: boolean; - priority?: RTCPriorityType; protocol?: string; } @@ -1202,7 +1200,6 @@ interface RTCErrorEventInit extends EventInit { interface RTCErrorInit { errorDetail: RTCErrorDetailType; - httpRequestStatusCode?: number; receivedAlert?: number; sctpCauseCode?: number; sdpLineNumber?: number; @@ -1292,7 +1289,7 @@ interface RTCIceParameters { } interface RTCIceServer { - credential?: string | RTCOAuthCredential; + credential?: string; credentialType?: RTCIceCredentialType; urls: string | string[]; username?: string; @@ -1312,6 +1309,11 @@ interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { packetsReceived?: number; } +interface RTCLocalSessionDescriptionInit { + sdp?: string; + type?: RTCSdpType; +} + interface RTCMediaStreamTrackStats extends RTCStats { audioLevel?: number; echoReturnLoss?: number; @@ -1329,13 +1331,7 @@ interface RTCMediaStreamTrackStats extends RTCStats { trackIdentifier?: string; } -interface RTCOAuthCredential { - accessToken: string; - macKey: string; -} - interface RTCOfferAnswerOptions { - voiceActivityDetection?: boolean; } interface RTCOfferOptions extends RTCOfferAnswerOptions { @@ -1352,8 +1348,9 @@ interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { } interface RTCPeerConnectionIceErrorEventInit extends EventInit { + address?: string | null; errorCode: number; - hostCandidate?: string; + port?: number | null; statusText?: string; url?: string; } @@ -1418,16 +1415,9 @@ interface RTCRtpContributingSource { timestamp: number; } -interface RTCRtpDecodingParameters extends RTCRtpCodingParameters { -} - interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { active?: boolean; - codecPayloadType?: number; - dtx?: RTCDtxStatus; maxBitrate?: number; - maxFramerate?: number; - ptime?: number; scaleResolutionDownBy?: number; } @@ -1460,7 +1450,6 @@ interface RTCRtpParameters { } interface RTCRtpReceiveParameters extends RTCRtpParameters { - encodings: RTCRtpDecodingParameters[]; } interface RTCRtpRtxParameters { @@ -1468,9 +1457,7 @@ interface RTCRtpRtxParameters { } interface RTCRtpSendParameters extends RTCRtpParameters { - degradationPreference?: RTCDegradationPreference; encodings: RTCRtpEncodingParameters[]; - priority?: RTCPriorityType; transactionId: string; } @@ -1492,7 +1479,7 @@ interface RTCRtpUnhandled { interface RTCSessionDescriptionInit { sdp?: string; - type?: RTCSdpType; + type: RTCSdpType; } interface RTCSrtpKeyParam { @@ -1521,10 +1508,6 @@ interface RTCStats { type?: RTCStatsType; } -interface RTCStatsEventInit extends EventInit { - report: RTCStatsReport; -} - interface RTCStatsReport { } @@ -4753,7 +4736,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; createEvent(eventInterface: "RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface: "RTCStatsEvent"): RTCStatsEvent; createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent; createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; @@ -5003,7 +4985,6 @@ interface DocumentEvent { createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; createEvent(eventInterface: "RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface: "RTCStatsEvent"): RTCStatsEvent; createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent; createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; @@ -11957,7 +11938,6 @@ interface RTCCertificate { declare var RTCCertificate: { prototype: RTCCertificate; new(): RTCCertificate; - getSupportedAlgorithms(): AlgorithmIdentifier[]; }; interface RTCDTMFSenderEventMap { @@ -11987,7 +11967,7 @@ interface RTCDTMFToneChangeEvent extends Event { declare var RTCDTMFToneChangeEvent: { prototype: RTCDTMFToneChangeEvent; - new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; + new(type: string, eventInitDict?: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; }; interface RTCDataChannelEventMap { @@ -11999,7 +11979,7 @@ interface RTCDataChannelEventMap { } interface RTCDataChannel extends EventTarget { - binaryType: string; + binaryType: BinaryType; readonly bufferedAmount: number; bufferedAmountLowThreshold: number; readonly id: number | null; @@ -12013,7 +11993,6 @@ interface RTCDataChannel extends EventTarget { onmessage: ((this: RTCDataChannel, ev: MessageEvent) => any) | null; onopen: ((this: RTCDataChannel, ev: Event) => any) | null; readonly ordered: boolean; - readonly priority: RTCPriorityType; readonly protocol: string; readonly readyState: RTCDataChannelState; close(): void; @@ -12097,7 +12076,6 @@ declare var RTCDtmfSender: { interface RTCError extends DOMException { readonly errorDetail: RTCErrorDetailType; - readonly httpRequestStatusCode: number | null; readonly receivedAlert: number | null; readonly sctpCauseCode: number | null; readonly sdpLineNumber: number | null; @@ -12190,7 +12168,6 @@ interface RTCIceTransportEventMap { /** Provides access to information about the ICE transport layer over which the data is being sent and received. */ interface RTCIceTransport extends EventTarget { - readonly component: RTCIceComponent; readonly gatheringState: RTCIceGathererState; ongatheringstatechange: ((this: RTCIceTransport, ev: Event) => any) | null; onselectedcandidatepairchange: ((this: RTCIceTransport, ev: Event) => any) | null; @@ -12241,7 +12218,6 @@ interface RTCPeerConnectionEventMap { "icegatheringstatechange": Event; "negotiationneeded": Event; "signalingstatechange": Event; - "statsended": RTCStatsEvent; "track": RTCTrackEvent; } @@ -12264,7 +12240,6 @@ interface RTCPeerConnection extends EventTarget { onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null; onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null; onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null; - onstatsended: ((this: RTCPeerConnection, ev: RTCStatsEvent) => any) | null; ontrack: ((this: RTCPeerConnection, ev: RTCTrackEvent) => any) | null; readonly peerIdentity: Promise; readonly pendingLocalDescription: RTCSessionDescription | null; @@ -12286,7 +12261,8 @@ interface RTCPeerConnection extends EventTarget { getStats(selector?: MediaStreamTrack | null): Promise; getTransceivers(): RTCRtpTransceiver[]; removeTrack(sender: RTCRtpSender): void; - setConfiguration(configuration: RTCConfiguration): void; + restartIce(): void; + setConfiguration(configuration?: RTCConfiguration): void; setIdentityProvider(provider: string, options?: RTCIdentityProviderOptions): void; setLocalDescription(description: RTCSessionDescriptionInit): Promise; setRemoteDescription(description: RTCSessionDescriptionInit): Promise; @@ -12300,13 +12276,13 @@ declare var RTCPeerConnection: { prototype: RTCPeerConnection; new(configuration?: RTCConfiguration): RTCPeerConnection; generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise; - getDefaultIceServers(): RTCIceServer[]; }; interface RTCPeerConnectionIceErrorEvent extends Event { + readonly address: string | null; readonly errorCode: number; readonly errorText: string; - readonly hostCandidate: string; + readonly port: number | null; readonly url: string; } @@ -12318,7 +12294,6 @@ declare var RTCPeerConnectionIceErrorEvent: { /** Events that occurs in relation to ICE candidates with the target, usually an RTCPeerConnection. Only one event is of this type: icecandidate. */ interface RTCPeerConnectionIceEvent extends Event { readonly candidate: RTCIceCandidate | null; - readonly url: string | null; } declare var RTCPeerConnectionIceEvent: { @@ -12328,7 +12303,6 @@ declare var RTCPeerConnectionIceEvent: { /** This WebRTC API interface manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection. */ interface RTCRtpReceiver { - readonly rtcpTransport: RTCDtlsTransport | null; readonly track: MediaStreamTrack; readonly transport: RTCDtlsTransport | null; getContributingSources(): RTCRtpContributingSource[]; @@ -12346,7 +12320,6 @@ declare var RTCRtpReceiver: { /** Provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer. */ interface RTCRtpSender { readonly dtmf: RTCDTMFSender | null; - readonly rtcpTransport: RTCDtlsTransport | null; readonly track: MediaStreamTrack | null; readonly transport: RTCDtlsTransport | null; getParameters(): RTCRtpSendParameters; @@ -12407,7 +12380,7 @@ interface RTCSessionDescription { declare var RTCSessionDescription: { prototype: RTCSessionDescription; - new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription; + new(descriptionInitDict: RTCSessionDescriptionInit): RTCSessionDescription; }; interface RTCSrtpSdesTransportEventMap { @@ -12438,15 +12411,6 @@ declare var RTCSsrcConflictEvent: { new(): RTCSsrcConflictEvent; }; -interface RTCStatsEvent extends Event { - readonly report: RTCStatsReport; -} - -declare var RTCStatsEvent: { - prototype: RTCStatsEvent; - new(type: string, eventInitDict: RTCStatsEventInit): RTCStatsEvent; -}; - interface RTCStatsProvider extends EventTarget { getStats(): Promise; msGetStats(): Promise; @@ -20099,15 +20063,13 @@ type PushEncryptionKeyName = "auth" | "p256dh"; type PushPermissionState = "denied" | "granted" | "prompt"; type RTCBundlePolicy = "balanced" | "max-bundle" | "max-compat"; type RTCDataChannelState = "closed" | "closing" | "connecting" | "open"; -type RTCDegradationPreference = "balanced" | "maintain-framerate" | "maintain-resolution"; type RTCDtlsRole = "auto" | "client" | "server"; type RTCDtlsTransportState = "closed" | "connected" | "connecting" | "failed" | "new"; -type RTCDtxStatus = "disabled" | "enabled"; -type RTCErrorDetailType = "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "idp-bad-script-failure" | "idp-execution-failure" | "idp-load-failure" | "idp-need-login" | "idp-timeout" | "idp-tls-failure" | "idp-token-expired" | "idp-token-invalid" | "sctp-failure" | "sdp-syntax-error"; +type RTCErrorDetailType = "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "sctp-failure" | "sdp-syntax-error"; type RTCIceCandidateType = "host" | "prflx" | "relay" | "srflx"; type RTCIceComponent = "rtcp" | "rtp"; type RTCIceConnectionState = "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new"; -type RTCIceCredentialType = "oauth" | "password"; +type RTCIceCredentialType = "password"; type RTCIceGatherPolicy = "all" | "nohost" | "relay"; type RTCIceGathererState = "complete" | "gathering" | "new"; type RTCIceGatheringState = "complete" | "gathering" | "new"; @@ -20117,8 +20079,7 @@ type RTCIceTcpCandidateType = "active" | "passive" | "so"; type RTCIceTransportPolicy = "all" | "relay"; type RTCIceTransportState = "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new"; type RTCPeerConnectionState = "closed" | "connected" | "connecting" | "disconnected" | "failed" | "new"; -type RTCPriorityType = "high" | "low" | "medium" | "very-low"; -type RTCRtcpMuxPolicy = "negotiate" | "require"; +type RTCRtcpMuxPolicy = "require"; type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped"; type RTCSctpTransportState = "closed" | "connected" | "connecting"; type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback"; diff --git a/inputfiles/idl/WebRTC.widl b/inputfiles/idl/WebRTC.widl index 4fdc00497..b8ddca528 100644 --- a/inputfiles/idl/WebRTC.widl +++ b/inputfiles/idl/WebRTC.widl @@ -3,25 +3,18 @@ dictionary RTCConfiguration { RTCIceTransportPolicy iceTransportPolicy; RTCBundlePolicy bundlePolicy; RTCRtcpMuxPolicy rtcpMuxPolicy; - DOMString peerIdentity; sequence certificates; [EnforceRange] octet iceCandidatePoolSize = 0; }; enum RTCIceCredentialType { - "password", - "oauth" -}; - -dictionary RTCOAuthCredential { - required DOMString macKey; - required DOMString accessToken; + "password" }; dictionary RTCIceServer { required (DOMString or sequence) urls; DOMString username; - (DOMString or RTCOAuthCredential) credential; + DOMString credential; RTCIceCredentialType credentialType = "password"; }; @@ -37,14 +30,10 @@ enum RTCBundlePolicy { }; enum RTCRtcpMuxPolicy { - // At risk due to lack of implementers' interest. - "negotiate", "require" }; -dictionary RTCOfferAnswerOptions { - boolean voiceActivityDetection = true; -}; +dictionary RTCOfferAnswerOptions {}; dictionary RTCOfferOptions : RTCOfferAnswerOptions { boolean iceRestart = false; @@ -91,25 +80,24 @@ interface RTCPeerConnection : EventTarget { constructor(optional RTCConfiguration configuration = {}); Promise createOffer(optional RTCOfferOptions options = {}); Promise createAnswer(optional RTCAnswerOptions options = {}); - Promise setLocalDescription(optional RTCSessionDescriptionInit description = {}); + Promise setLocalDescription(optional RTCLocalSessionDescriptionInit description = {}); readonly attribute RTCSessionDescription? localDescription; readonly attribute RTCSessionDescription? currentLocalDescription; readonly attribute RTCSessionDescription? pendingLocalDescription; - Promise setRemoteDescription(optional RTCSessionDescriptionInit description = {}); + Promise setRemoteDescription(RTCSessionDescriptionInit description); readonly attribute RTCSessionDescription? remoteDescription; readonly attribute RTCSessionDescription? currentRemoteDescription; readonly attribute RTCSessionDescription? pendingRemoteDescription; - Promise addIceCandidate(optional RTCIceCandidateInit candidate = {}); + Promise addIceCandidate(optional RTCIceCandidateInit candidate = {}); readonly attribute RTCSignalingState signalingState; readonly attribute RTCIceGatheringState iceGatheringState; readonly attribute RTCIceConnectionState iceConnectionState; readonly attribute RTCPeerConnectionState connectionState; readonly attribute boolean? canTrickleIceCandidates; - void restartIce(); - static sequence getDefaultIceServers(); + undefined restartIce(); RTCConfiguration getConfiguration(); - void setConfiguration(RTCConfiguration configuration); - void close(); + undefined setConfiguration(optional RTCConfiguration configuration = {}); + undefined close(); attribute EventHandler onnegotiationneeded; attribute EventHandler onicecandidate; attribute EventHandler onicecandidateerror; @@ -123,25 +111,25 @@ interface RTCPeerConnection : EventTarget { // If these methods are supported // they must be implemented as defined // in section "Legacy Interface Extensions" - Promise createOffer(RTCSessionDescriptionCallback successCallback, + Promise createOffer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions options = {}); - Promise setLocalDescription(optional RTCSessionDescriptionInit description = {}, + Promise setLocalDescription(optional RTCLocalSessionDescriptionInit description = {}, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); - Promise createAnswer(RTCSessionDescriptionCallback successCallback, + Promise createAnswer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); - Promise setRemoteDescription(optional RTCSessionDescriptionInit description = {}, + Promise setRemoteDescription(RTCSessionDescriptionInit description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); - Promise addIceCandidate(RTCIceCandidateInit candidate, + Promise addIceCandidate(RTCIceCandidateInit candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); }; -callback RTCPeerConnectionErrorCallback = void (DOMException error); +callback RTCPeerConnectionErrorCallback = undefined (DOMException error); -callback RTCSessionDescriptionCallback = void (RTCSessionDescriptionInit description); +callback RTCSessionDescriptionCallback = undefined (RTCSessionDescriptionInit description); partial dictionary RTCOfferOptions { boolean offerToReceiveAudio; @@ -157,13 +145,18 @@ enum RTCSdpType { [Exposed=Window] interface RTCSessionDescription { - constructor(optional RTCSessionDescriptionInit descriptionInitDict = {}); + constructor(RTCSessionDescriptionInit descriptionInitDict); readonly attribute RTCSdpType type; readonly attribute DOMString sdp; [Default] object toJSON(); }; dictionary RTCSessionDescriptionInit { + required RTCSdpType type; + DOMString sdp = ""; +}; + +dictionary RTCLocalSessionDescriptionInit { RTCSdpType type; DOMString sdp = ""; }; @@ -228,26 +221,21 @@ dictionary RTCPeerConnectionIceEventInit : EventInit { [Exposed=Window] interface RTCPeerConnectionIceErrorEvent : Event { constructor(DOMString type, RTCPeerConnectionIceErrorEventInit eventInitDict); - readonly attribute DOMString hostCandidate; + readonly attribute DOMString? address; + readonly attribute unsigned short? port; readonly attribute DOMString url; readonly attribute unsigned short errorCode; readonly attribute USVString errorText; }; dictionary RTCPeerConnectionIceErrorEventInit : EventInit { - DOMString hostCandidate; + DOMString? address; + unsigned short? port; DOMString url; required unsigned short errorCode; USVString statusText; }; -enum RTCPriorityType { - "very-low", - "low", - "medium", - "high" -}; - partial interface RTCPeerConnection { static Promise generateCertificate(AlgorithmIdentifier keygenAlgorithm); @@ -260,7 +248,6 @@ dictionary RTCCertificateExpiration { [Exposed=Window, Serializable] interface RTCCertificate { readonly attribute DOMTimeStamp expires; - static sequence getSupportedAlgorithms(); sequence getFingerprints(); }; @@ -269,7 +256,7 @@ partial interface RTCPeerConnection { sequence getReceivers(); sequence getTransceivers(); RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams); - void removeTrack(RTCRtpSender sender); + undefined removeTrack(RTCRtpSender sender); RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind, optional RTCRtpTransceiverInit init = {}); attribute EventHandler ontrack; @@ -293,12 +280,11 @@ enum RTCRtpTransceiverDirection { interface RTCRtpSender { readonly attribute MediaStreamTrack? track; readonly attribute RTCDtlsTransport? transport; - readonly attribute RTCDtlsTransport? rtcpTransport; static RTCRtpCapabilities? getCapabilities(DOMString kind); - Promise setParameters(RTCRtpSendParameters parameters); + Promise setParameters(RTCRtpSendParameters parameters); RTCRtpSendParameters getParameters(); - Promise replaceTrack(MediaStreamTrack? withTrack); - void setStreams(MediaStream... streams); + Promise replaceTrack(MediaStreamTrack? withTrack); + undefined setStreams(MediaStream... streams); Promise getStats(); }; @@ -311,12 +297,9 @@ dictionary RTCRtpParameters { dictionary RTCRtpSendParameters : RTCRtpParameters { required DOMString transactionId; required sequence encodings; - RTCDegradationPreference degradationPreference = "balanced"; - RTCPriorityType priority = "low"; }; dictionary RTCRtpReceiveParameters : RTCRtpParameters { - required sequence encodings; }; dictionary RTCRtpCodingParameters { @@ -326,26 +309,11 @@ dictionary RTCRtpCodingParameters { dictionary RTCRtpDecodingParameters : RTCRtpCodingParameters {}; dictionary RTCRtpEncodingParameters : RTCRtpCodingParameters { - octet codecPayloadType; - RTCDtxStatus dtx; boolean active = true; - unsigned long ptime; unsigned long maxBitrate; - double maxFramerate; double scaleResolutionDownBy; }; -enum RTCDtxStatus { - "disabled", - "enabled" -}; - -enum RTCDegradationPreference { - "maintain-framerate", - "maintain-resolution", - "balanced" -}; - dictionary RTCRtcpParameters { DOMString cname; boolean reducedSize; @@ -385,7 +353,6 @@ dictionary RTCRtpHeaderExtensionCapability { interface RTCRtpReceiver { readonly attribute MediaStreamTrack track; readonly attribute RTCDtlsTransport? transport; - readonly attribute RTCDtlsTransport? rtcpTransport; static RTCRtpCapabilities? getCapabilities(DOMString kind); RTCRtpReceiveParameters getParameters(); sequence getContributingSources(); @@ -411,8 +378,8 @@ interface RTCRtpTransceiver { [SameObject] readonly attribute RTCRtpReceiver receiver; attribute RTCRtpTransceiverDirection direction; readonly attribute RTCRtpTransceiverDirection? currentDirection; - void stop(); - void setCodecPreferences(sequence codecs); + undefined stop(); + undefined setCodecPreferences(sequence codecs); }; [Exposed=Window] @@ -537,7 +504,6 @@ interface RTCDataChannel : EventTarget { readonly attribute USVString protocol; readonly attribute boolean negotiated; readonly attribute unsigned short? id; - readonly attribute RTCPriorityType priority; readonly attribute RTCDataChannelState readyState; readonly attribute unsigned long bufferedAmount; [EnforceRange] attribute unsigned long bufferedAmountLowThreshold; @@ -546,13 +512,13 @@ interface RTCDataChannel : EventTarget { attribute EventHandler onerror; attribute EventHandler onclosing; attribute EventHandler onclose; - void close(); + undefined close(); attribute EventHandler onmessage; - attribute DOMString binaryType; - void send(USVString data); - void send(Blob data); - void send(ArrayBuffer data); - void send(ArrayBufferView data); + attribute BinaryType binaryType; + undefined send(USVString data); + undefined send(Blob data); + undefined send(ArrayBuffer data); + undefined send(ArrayBufferView data); }; dictionary RTCDataChannelInit { @@ -562,7 +528,6 @@ dictionary RTCDataChannelInit { USVString protocol = ""; boolean negotiated = false; [EnforceRange] unsigned short id; - RTCPriorityType priority = "low"; }; enum RTCDataChannelState { @@ -588,7 +553,7 @@ partial interface RTCRtpSender { [Exposed=Window] interface RTCDTMFSender : EventTarget { - void insertDTMF(DOMString tones, optional unsigned long duration = 100, optional unsigned long interToneGap = 70); + undefined insertDTMF(DOMString tones, optional unsigned long duration = 100, optional unsigned long interToneGap = 70); attribute EventHandler ontonechange; readonly attribute boolean canInsertDTMF; readonly attribute DOMString toneBuffer; @@ -596,17 +561,16 @@ interface RTCDTMFSender : EventTarget { [Exposed=Window] interface RTCDTMFToneChangeEvent : Event { - constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict); + constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict = {}); readonly attribute DOMString tone; }; dictionary RTCDTMFToneChangeEventInit : EventInit { - required DOMString tone; + DOMString tone = ""; }; partial interface RTCPeerConnection { Promise getStats(optional MediaStreamTrack? selector = null); - attribute EventHandler onstatsended; }; [Exposed=Window] @@ -620,22 +584,11 @@ dictionary RTCStats { required DOMString id; }; -[Exposed=Window] -interface RTCStatsEvent : Event { - constructor(DOMString type, RTCStatsEventInit eventInitDict); - readonly attribute RTCStatsReport report; -}; - -dictionary RTCStatsEventInit : EventInit { - required RTCStatsReport report; -}; - [Exposed=Window] interface RTCError : DOMException { constructor(RTCErrorInit init, optional DOMString message = ""); readonly attribute RTCErrorDetailType errorDetail; readonly attribute long? sdpLineNumber; - readonly attribute long? httpRequestStatusCode; readonly attribute long? sctpCauseCode; readonly attribute unsigned long? receivedAlert; readonly attribute unsigned long? sentAlert; @@ -644,7 +597,6 @@ interface RTCError : DOMException { dictionary RTCErrorInit { required RTCErrorDetailType errorDetail; long sdpLineNumber; - long httpRequestStatusCode; long sctpCauseCode; unsigned long receivedAlert; unsigned long sentAlert; @@ -654,14 +606,6 @@ enum RTCErrorDetailType { "data-channel-failure", "dtls-failure", "fingerprint-failure", - "idp-bad-script-failure", - "idp-execution-failure", - "idp-load-failure", - "idp-need-login", - "idp-timeout", - "idp-tls-failure", - "idp-token-expired", - "idp-token-invalid", "sctp-failure", "sdp-syntax-error", "hardware-encoder-not-available", diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index e022959bf..1670a93c6 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -1931,10 +1931,6 @@ { "name": "isolationchange", "type": "Event" - }, - { - "name": "statsended", - "type": "RTCStatsEvent" } ] } diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index e3982e564..05dd7bceb 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -278,10 +278,17 @@ } } }, - "RTCPeerConnection": { - "methods": { - "method": { - "restartIce": null + "RTCIceTransport": { + "properties": { + "property": { + "component": null + } + } + }, + "RTCPeerConnectionIceEvent": { + "properties": { + "property": { + "url": null } } }, From a1a1491b570ff094d017774dd3e6385e46081851 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 02:39:08 +0200 Subject: [PATCH 10/20] Add Payment Request types --- baselines/dom.generated.d.ts | 69 +++++++++- inputfiles/idl/Payment Request.widl | 188 ++++++++++++++++++++++++++++ inputfiles/idlSources.json | 4 + 3 files changed, 255 insertions(+), 6 deletions(-) create mode 100644 inputfiles/idl/Payment Request.widl diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 524d5f13d..0e4da5b04 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -15,6 +15,19 @@ interface AddEventListenerOptions extends EventListenerOptions { passive?: boolean; } +interface AddressErrors { + addressLine?: string; + city?: string; + country?: string; + dependentLocality?: string; + organization?: string; + phone?: string; + postalCode?: string; + recipient?: string; + region?: string; + sortingCode?: string; +} + interface AesCbcParams extends Algorithm { iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } @@ -946,9 +959,14 @@ interface PannerOptions extends AudioNodeOptions { rolloffFactor?: number; } +interface PayerErrors { + email?: string; + name?: string; + phone?: string; +} + interface PaymentCurrencyAmount { currency: string; - currencySystem?: string; value: string; } @@ -972,6 +990,9 @@ interface PaymentDetailsModifier { interface PaymentDetailsUpdate extends PaymentDetailsBase { error?: string; + payerErrors?: PayerErrors; + paymentMethodErrors?: any; + shippingAddressErrors?: AddressErrors; total?: PaymentItem; } @@ -981,17 +1002,23 @@ interface PaymentItem { pending?: boolean; } +interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { + methodDetails?: any; + methodName?: string; +} + interface PaymentMethodData { data?: any; supportedMethods: string | string[]; } interface PaymentOptions { + requestBillingAddress?: boolean; requestPayerEmail?: boolean; requestPayerName?: boolean; requestPayerPhone?: boolean; requestShipping?: boolean; - shippingType?: string; + shippingType?: PaymentShippingType; } interface PaymentRequestUpdateEventInit extends EventInit { @@ -1004,6 +1031,13 @@ interface PaymentShippingOption { selected?: boolean; } +interface PaymentValidationErrors { + error?: string; + payer?: PayerErrors; + paymentMethod?: any; + shippingAddress?: AddressErrors; +} + interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; @@ -4720,6 +4754,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "OverflowEvent"): OverflowEvent; createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; createEvent(eventInterface: "PermissionRequestedEvent"): PermissionRequestedEvent; createEvent(eventInterface: "PointerEvent"): PointerEvent; @@ -4969,6 +5004,7 @@ interface DocumentEvent { createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "OverflowEvent"): OverflowEvent; createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; createEvent(eventInterface: "PermissionRequestedEvent"): PermissionRequestedEvent; createEvent(eventInterface: "PointerEvent"): PointerEvent; @@ -11417,11 +11453,10 @@ declare var Path2D: { /** This Payment Request API interface is used to store shipping or payment address information. */ interface PaymentAddress { - readonly addressLine: string[]; + readonly addressLine: ReadonlyArray; readonly city: string; readonly country: string; readonly dependentLocality: string; - readonly languageCode: string; readonly organization: string; readonly phone: string; readonly postalCode: string; @@ -11436,7 +11471,18 @@ declare var PaymentAddress: { new(): PaymentAddress; }; +interface PaymentMethodChangeEvent extends PaymentRequestUpdateEvent { + readonly methodDetails: any; + readonly methodName: string; +} + +declare var PaymentMethodChangeEvent: { + prototype: PaymentMethodChangeEvent; + new(type: string, eventInitDict?: PaymentMethodChangeEventInit): PaymentMethodChangeEvent; +}; + interface PaymentRequestEventMap { + "paymentmethodchange": Event; "shippingaddresschange": Event; "shippingoptionchange": Event; } @@ -11444,6 +11490,7 @@ interface PaymentRequestEventMap { /** This Payment Request API interface is the primary access point into the API, and lets web content and apps accept payments from the end user. */ interface PaymentRequest extends EventTarget { readonly id: string; + onpaymentmethodchange: ((this: PaymentRequest, ev: Event) => any) | null; onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null; onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null; readonly shippingAddress: PaymentAddress | null; @@ -11451,7 +11498,7 @@ interface PaymentRequest extends EventTarget { readonly shippingType: PaymentShippingType | null; abort(): Promise; canMakePayment(): Promise; - show(): Promise; + show(detailsPromise: PaymentDetailsUpdate | Promise): Promise; addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -11473,10 +11520,15 @@ declare var PaymentRequestUpdateEvent: { new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent; }; +interface PaymentResponseEventMap { + "payerdetailchange": Event; +} + /** This Payment Request API interface is returned after a user selects a payment method and approves a payment request. */ -interface PaymentResponse { +interface PaymentResponse extends EventTarget { readonly details: any; readonly methodName: string; + onpayerdetailchange: ((this: PaymentResponse, ev: Event) => any) | null; readonly payerEmail: string | null; readonly payerName: string | null; readonly payerPhone: string | null; @@ -11484,7 +11536,12 @@ interface PaymentResponse { readonly shippingAddress: PaymentAddress | null; readonly shippingOption: string | null; complete(result?: PaymentComplete): Promise; + retry(errorFields?: PaymentValidationErrors): Promise; toJSON(): any; + addEventListener(type: K, listener: (this: PaymentResponse, ev: PaymentResponseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: PaymentResponse, ev: PaymentResponseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var PaymentResponse: { diff --git a/inputfiles/idl/Payment Request.widl b/inputfiles/idl/Payment Request.widl new file mode 100644 index 000000000..0b260ac7e --- /dev/null +++ b/inputfiles/idl/Payment Request.widl @@ -0,0 +1,188 @@ +[SecureContext, Exposed=Window] +interface PaymentRequest : EventTarget { + constructor( + sequence methodData, + PaymentDetailsInit details, + optional PaymentOptions options = {} + ); + [NewObject] + Promise show(optional Promise detailsPromise); + [NewObject] + Promise abort(); + [NewObject] + Promise canMakePayment(); + + readonly attribute DOMString id; + readonly attribute PaymentAddress? shippingAddress; + readonly attribute DOMString? shippingOption; + readonly attribute PaymentShippingType? shippingType; + + attribute EventHandler onshippingaddresschange; + attribute EventHandler onshippingoptionchange; + attribute EventHandler onpaymentmethodchange; +}; + +dictionary PaymentMethodData { + required DOMString supportedMethods; + object data; +}; + +dictionary PaymentCurrencyAmount { + required DOMString currency; + required DOMString value; +}; + +dictionary PaymentDetailsBase { + sequence displayItems; + sequence shippingOptions; + sequence modifiers; +}; + +dictionary PaymentDetailsInit : PaymentDetailsBase { + DOMString id; + required PaymentItem total; +}; + +dictionary PaymentDetailsUpdate : PaymentDetailsBase { + DOMString error; + PaymentItem total; + AddressErrors shippingAddressErrors; + PayerErrors payerErrors; + object paymentMethodErrors; +}; + +dictionary PaymentDetailsModifier { + required DOMString supportedMethods; + PaymentItem total; + sequence additionalDisplayItems; + object data; +}; + +enum PaymentShippingType { + "shipping", + "delivery", + "pickup" +}; + +dictionary PaymentOptions { + boolean requestPayerName = false; + boolean requestBillingAddress = false; + boolean requestPayerEmail = false; + boolean requestPayerPhone = false; + boolean requestShipping = false; + PaymentShippingType shippingType = "shipping"; +}; + +dictionary PaymentItem { + required DOMString label; + required PaymentCurrencyAmount amount; + boolean pending = false; +}; + +[SecureContext, Exposed=(Window)] +interface PaymentAddress { + [Default] object toJSON(); + readonly attribute DOMString city; + readonly attribute DOMString country; + readonly attribute DOMString dependentLocality; + readonly attribute DOMString organization; + readonly attribute DOMString phone; + readonly attribute DOMString postalCode; + readonly attribute DOMString recipient; + readonly attribute DOMString region; + readonly attribute DOMString sortingCode; + readonly attribute FrozenArray addressLine; +}; + +dictionary AddressInit { + DOMString country = ""; + sequence addressLine = []; + DOMString region = ""; + DOMString city = ""; + DOMString dependentLocality = ""; + DOMString postalCode = ""; + DOMString sortingCode = ""; + DOMString organization = ""; + DOMString recipient = ""; + DOMString phone = ""; +}; + +dictionary AddressErrors { + DOMString addressLine; + DOMString city; + DOMString country; + DOMString dependentLocality; + DOMString organization; + DOMString phone; + DOMString postalCode; + DOMString recipient; + DOMString region; + DOMString sortingCode; +}; + +dictionary PaymentShippingOption { + required DOMString id; + required DOMString label; + required PaymentCurrencyAmount amount; + boolean selected = false; +}; + +enum PaymentComplete { + "fail", + "success", + "unknown" +}; + +[SecureContext, Exposed=Window] +interface PaymentResponse : EventTarget { + [Default] object toJSON(); + + readonly attribute DOMString requestId; + readonly attribute DOMString methodName; + readonly attribute object details; + readonly attribute PaymentAddress? shippingAddress; + readonly attribute DOMString? shippingOption; + readonly attribute DOMString? payerName; + readonly attribute DOMString? payerEmail; + readonly attribute DOMString? payerPhone; + + [NewObject] + Promise complete(optional PaymentComplete result = "unknown"); + [NewObject] + Promise retry(optional PaymentValidationErrors errorFields = {}); + + attribute EventHandler onpayerdetailchange; +}; + +dictionary PaymentValidationErrors { + PayerErrors payer; + AddressErrors shippingAddress; + DOMString error; + object paymentMethod; +}; + +dictionary PayerErrors { + DOMString email; + DOMString name; + DOMString phone; +}; + +[SecureContext, Exposed=Window] +interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent { + constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict = {}); + readonly attribute DOMString methodName; + readonly attribute object? methodDetails; +}; + +dictionary PaymentMethodChangeEventInit : PaymentRequestUpdateEventInit { + DOMString methodName = ""; + object? methodDetails = null; +}; + +[SecureContext, Exposed=Window] +interface PaymentRequestUpdateEvent : Event { + constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict = {}); + undefined updateWith(Promise detailsPromise); +}; + +dictionary PaymentRequestUpdateEventInit : EventInit {}; diff --git a/inputfiles/idlSources.json b/inputfiles/idlSources.json index ad0e4f891..a52edd252 100644 --- a/inputfiles/idlSources.json +++ b/inputfiles/idlSources.json @@ -434,6 +434,10 @@ "url": "https://www.w3.org/TR/push-api/", "title": "Push" }, + { + "url": "https://w3c.github.io/payment-request/", + "title": "Payment Request" + }, { "url": "https://www.w3.org/TR/referrer-policy/", "title": "Referrer Policy" From fce90f54c7eb69ad6ba8e7c391ab66030253362a Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 02:09:41 +0200 Subject: [PATCH 11/20] Remove MediaStreamTrack isolation --- baselines/dom.generated.d.ts | 3 --- inputfiles/removedTypes.json | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 0e4da5b04..120dad4d1 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -10434,7 +10434,6 @@ declare var MediaStreamEvent: { interface MediaStreamTrackEventMap { "ended": Event; - "isolationchange": Event; "mute": Event; "unmute": Event; } @@ -10443,12 +10442,10 @@ interface MediaStreamTrackEventMap { interface MediaStreamTrack extends EventTarget { enabled: boolean; readonly id: string; - readonly isolated: boolean; readonly kind: string; readonly label: string; readonly muted: boolean; onended: ((this: MediaStreamTrack, ev: Event) => any) | null; - onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null; onmute: ((this: MediaStreamTrack, ev: Event) => any) | null; onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null; readonly readyState: MediaStreamTrackState; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 05dd7bceb..9cb20e37a 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -234,6 +234,14 @@ } } }, + "MediaStreamTrack": { + "properties": { + "property": { + "isolated": null, + "onisolationchange": null + } + } + }, "MessageEvent": { "methods": { "method": { From 45a0ea2078496a244afd38fc0bda31e527d09646 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 01:56:19 +0200 Subject: [PATCH 12/20] Remove MS-prefixed events --- baselines/dom.generated.d.ts | 132 ----------------------------------- inputfiles/removedTypes.json | 19 +++++ 2 files changed, 19 insertions(+), 132 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 120dad4d1..5b3f489cb 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -4736,10 +4736,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "InputEvent"): InputEvent; createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; createEvent(eventInterface: "ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface: "MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; @@ -4986,10 +4982,6 @@ interface DocumentEvent { createEvent(eventInterface: "InputEvent"): InputEvent; createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; createEvent(eventInterface: "ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface: "MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; @@ -9936,43 +9928,6 @@ declare var MSGesture: { new(): MSGesture; }; -/** The MSGestureEvent is a proprietary interface specific to Internet Explorer and Microsoft Edge which represents events that occur due to touch gestures. Events using this interface include MSGestureStart, MSGestureEnd, MSGestureTap, MSGestureHold, MSGestureChange, and MSInertiaStart. */ -interface MSGestureEvent extends UIEvent { - readonly clientX: number; - readonly clientY: number; - readonly expansion: number; - readonly gestureObject: any; - readonly hwTimestamp: number; - readonly offsetX: number; - readonly offsetY: number; - readonly rotation: number; - readonly scale: number; - readonly screenX: number; - readonly screenY: number; - readonly translationX: number; - readonly translationY: number; - readonly velocityAngular: number; - readonly velocityExpansion: number; - readonly velocityX: number; - readonly velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -}; - /** The msGraphicsTrust() constructor returns an object that provides properties for info on protected video playback. */ interface MSGraphicsTrust { readonly constrictionActive: boolean; @@ -10034,25 +9989,6 @@ declare var MSMediaKeyError: { readonly MS_MEDIA_KEYERR_UNKNOWN: number; }; -interface MSMediaKeyMessageEvent extends Event { - readonly destinationURL: string | null; - readonly message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -}; - -interface MSMediaKeyNeededEvent extends Event { - readonly initData: Uint8Array | null; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -}; - interface MSMediaKeySession extends EventTarget { readonly error: MSMediaKeyError | null; readonly keySystem: string; @@ -10087,29 +10023,6 @@ interface MSNavigatorDoNotTrack { storeWebWideTrackingException(args: StoreExceptionsInformation): void; } -interface MSPointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -}; - interface MSStream { readonly type: string; msClose(): void; @@ -18449,21 +18362,6 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler "mouseover": MouseEvent; "mouseup": MouseEvent; "mousewheel": Event; - "MSGestureChange": Event; - "MSGestureDoubleTap": Event; - "MSGestureEnd": Event; - "MSGestureHold": Event; - "MSGestureStart": Event; - "MSGestureTap": Event; - "MSInertiaStart": Event; - "MSPointerCancel": Event; - "MSPointerDown": Event; - "MSPointerEnter": Event; - "MSPointerLeave": Event; - "MSPointerMove": Event; - "MSPointerOut": Event; - "MSPointerOver": Event; - "MSPointerUp": Event; "offline": Event; "online": Event; "orientationchange": Event; @@ -18533,21 +18431,6 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null; ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null; onmousewheel: ((this: Window, ev: Event) => any) | null; - onmsgesturechange: ((this: Window, ev: Event) => any) | null; - onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; - onmsgestureend: ((this: Window, ev: Event) => any) | null; - onmsgesturehold: ((this: Window, ev: Event) => any) | null; - onmsgesturestart: ((this: Window, ev: Event) => any) | null; - onmsgesturetap: ((this: Window, ev: Event) => any) | null; - onmsinertiastart: ((this: Window, ev: Event) => any) | null; - onmspointercancel: ((this: Window, ev: Event) => any) | null; - onmspointerdown: ((this: Window, ev: Event) => any) | null; - onmspointerenter: ((this: Window, ev: Event) => any) | null; - onmspointerleave: ((this: Window, ev: Event) => any) | null; - onmspointermove: ((this: Window, ev: Event) => any) | null; - onmspointerout: ((this: Window, ev: Event) => any) | null; - onmspointerover: ((this: Window, ev: Event) => any) | null; - onmspointerup: ((this: Window, ev: Event) => any) | null; /** @deprecated */ onorientationchange: ((this: Window, ev: Event) => any) | null; onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null; @@ -19580,21 +19463,6 @@ declare var ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEv declare var ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null; declare var ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null; declare var onmousewheel: ((this: Window, ev: Event) => any) | null; -declare var onmsgesturechange: ((this: Window, ev: Event) => any) | null; -declare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; -declare var onmsgestureend: ((this: Window, ev: Event) => any) | null; -declare var onmsgesturehold: ((this: Window, ev: Event) => any) | null; -declare var onmsgesturestart: ((this: Window, ev: Event) => any) | null; -declare var onmsgesturetap: ((this: Window, ev: Event) => any) | null; -declare var onmsinertiastart: ((this: Window, ev: Event) => any) | null; -declare var onmspointercancel: ((this: Window, ev: Event) => any) | null; -declare var onmspointerdown: ((this: Window, ev: Event) => any) | null; -declare var onmspointerenter: ((this: Window, ev: Event) => any) | null; -declare var onmspointerleave: ((this: Window, ev: Event) => any) | null; -declare var onmspointermove: ((this: Window, ev: Event) => any) | null; -declare var onmspointerout: ((this: Window, ev: Event) => any) | null; -declare var onmspointerover: ((this: Window, ev: Event) => any) | null; -declare var onmspointerup: ((this: Window, ev: Event) => any) | null; /** @deprecated */ declare var onorientationchange: ((this: Window, ev: Event) => any) | null; declare var onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 9cb20e37a..4bd5cfffc 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -252,6 +252,10 @@ "MSCredentials": null, "MSDCCEvent": null, "MSDSHEvent": null, + "MSGestureEvent": null, + "MSMediaKeyMessageEvent": null, + "MSMediaKeyNeededEvent": null, + "MSPointerEvent": null, "MSStreamReader": null, "PasswordCredential": null, "Position": null, @@ -472,6 +476,21 @@ "crypto": null, "isSecureContext": null, "msCredentials": null, + "onmsgesturechange": null, + "onmsgesturedoubletap": null, + "onmsgestureend": null, + "onmsgesturehold": null, + "onmsgesturestart": null, + "onmsgesturetap": null, + "onmsinertiastart": null, + "onmspointercancel": null, + "onmspointerdown": null, + "onmspointerenter": null, + "onmspointerleave": null, + "onmspointermove": null, + "onmspointerout": null, + "onmspointerover": null, + "onmspointerup": null, "ontouchcancel": null, "ontouchend": null, "ontouchmove": null, From a879898ff70fc6c98842e68999c58b62b49f7bbf Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 01:37:10 +0200 Subject: [PATCH 13/20] Remove HTMLBaseFontElement --- baselines/dom.generated.d.ts | 28 ---------------------------- inputfiles/comments.json | 12 ------------ inputfiles/removedTypes.json | 1 + 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 5b3f489cb..852ac2da5 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -3888,10 +3888,6 @@ declare var DOMImplementation: { new(): DOMImplementation; }; -interface DOML2DeprecatedColorProperty { - color: string; -} - interface DOMMatrix extends DOMMatrixReadOnly { a: number; b: number; @@ -6349,29 +6345,6 @@ declare var HTMLBaseElement: { new(): HTMLBaseElement; }; -/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating elements. */ -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - /** @deprecated */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - /** @deprecated */ - size: number; - addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -}; - interface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap { "orientationchange": Event; } @@ -19241,7 +19214,6 @@ interface HTMLElementTagNameMap { "audio": HTMLAudioElement; "b": HTMLElement; "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; "bdi": HTMLElement; "bdo": HTMLElement; "blockquote": HTMLQuoteElement; diff --git a/inputfiles/comments.json b/inputfiles/comments.json index b048148ea..6fbe5b28d 100644 --- a/inputfiles/comments.json +++ b/inputfiles/comments.json @@ -1338,18 +1338,6 @@ } } }, - "HTMLBaseFontElement": { - "properties": { - "property": { - "face": { - "comment": "/**\n * Sets or retrieves the current typeface family.\n */" - }, - "size": { - "comment": "/**\n * Sets or retrieves the font size of the object.\n */" - } - } - } - }, "HTMLTextAreaElement": { "properties": { "property": { diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 4bd5cfffc..91ac1cfd2 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -201,6 +201,7 @@ "FederatedCredential": null, "FormDataEvent": null, "HTMLAreasCollection": null, + "HTMLBaseFontElement": null, "HTMLMediaElement": { "properties": { "property": { From 5df008b80d4968383e81aa5d0eb847a30303818c Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 01:11:56 +0200 Subject: [PATCH 14/20] Remove ServiceWorkerMessageEvent --- baselines/dom.generated.d.ts | 26 -------------------------- inputfiles/removedTypes.json | 1 + 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 852ac2da5..7d4816d07 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1749,14 +1749,6 @@ interface SecurityPolicyViolationEventInit extends EventInit { violatedDirective?: string; } -interface ServiceWorkerMessageEventInit extends EventInit { - data?: any; - lastEventId?: string; - origin?: string; - ports?: MessagePort[] | null; - source?: ServiceWorker | MessagePort | null; -} - interface ShadowRootInit { delegatesFocus?: boolean; mode: ShadowRootMode; @@ -4767,7 +4759,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent; createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; - createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent; createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; @@ -5013,7 +5004,6 @@ interface DocumentEvent { createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent; createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; - createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent; createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; @@ -14898,22 +14888,6 @@ declare var ServiceWorkerContainer: { new(): ServiceWorkerContainer; }; -/** This ServiceWorker API interface contains information about an event sent to a ServiceWorkerContainer target. This extends the default message event to allow setting a ServiceWorker object as the source of a message. The event object is accessed via the handler function of a message event, when fired by a message received from a service worker. - * @deprecated In modern browsers, this interface has been deprecated. Service worker messages will now use the MessageEvent interface, for consistency with other web messaging features. - */ -interface ServiceWorkerMessageEvent extends Event { - readonly data: any; - readonly lastEventId: string; - readonly origin: string; - readonly ports: ReadonlyArray | null; - readonly source: ServiceWorker | MessagePort | null; -} - -declare var ServiceWorkerMessageEvent: { - prototype: ServiceWorkerMessageEvent; - new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent; -}; - interface ServiceWorkerRegistrationEventMap { "updatefound": Event; } diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 91ac1cfd2..f31f531de 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -312,6 +312,7 @@ } } }, + "ServiceWorkerMessageEvent": null, "ShadowRoot": { "properties": { "property": { From 6444df56d462820bf3bd77ade0e02f8adf5b610a Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 24 Oct 2020 23:59:35 +0200 Subject: [PATCH 15/20] Remove DeviceLightEvent --- baselines/dom.generated.d.ts | 19 ------------------- inputfiles/removedTypes.json | 7 +++++++ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 7d4816d07..7cdba2c29 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -358,10 +358,6 @@ interface DelayOptions extends AudioNodeOptions { maxDelayTime?: number; } -interface DeviceLightEventInit extends EventInit { - value?: number; -} - interface DeviceMotionEventAccelerationInit { x?: number | null; y?: number | null; @@ -4365,16 +4361,6 @@ declare var DeviceAcceleration: { new(): DeviceAcceleration; }; -/** The DeviceLightEvent provides web developers with information from photo sensors or similiar detectors about ambient light levels near the device. For example this may be useful to adjust the screen's brightness based on the current ambient light level in order to save energy or provide better readability. */ -interface DeviceLightEvent extends Event { - readonly value: number; -} - -declare var DeviceLightEvent: { - prototype: DeviceLightEvent; - new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; -}; - /** The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. */ interface DeviceMotionEvent extends Event { readonly acceleration: DeviceMotionEventAcceleration | null; @@ -4709,7 +4695,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "CloseEvent"): CloseEvent; createEvent(eventInterface: "CompositionEvent"): CompositionEvent; createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceLightEvent"): DeviceLightEvent; createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface: "DragEvent"): DragEvent; @@ -4954,7 +4939,6 @@ interface DocumentEvent { createEvent(eventInterface: "CloseEvent"): CloseEvent; createEvent(eventInterface: "CompositionEvent"): CompositionEvent; createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceLightEvent"): DeviceLightEvent; createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface: "DragEvent"): DragEvent; @@ -18272,7 +18256,6 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler "compassneedscalibration": Event; "contextmenu": MouseEvent; "dblclick": MouseEvent; - "devicelight": DeviceLightEvent; "devicemotion": DeviceMotionEvent; "deviceorientation": DeviceOrientationEvent; "deviceorientationabsolute": DeviceOrientationEvent; @@ -18371,7 +18354,6 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler readonly navigator: Navigator; offscreenBuffering: string | boolean; oncompassneedscalibration: ((this: Window, ev: Event) => any) | null; - ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null; @@ -19402,7 +19384,6 @@ declare const name: void; declare var navigator: Navigator; declare var offscreenBuffering: string | boolean; declare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null; -declare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; declare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; declare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; declare var ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null; diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index f31f531de..5108ecdce 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -197,6 +197,7 @@ } } }, + "DeviceLightEvent": null, "ElementInternals": null, "FederatedCredential": null, "FormDataEvent": null, @@ -478,6 +479,7 @@ "crypto": null, "isSecureContext": null, "msCredentials": null, + "ondevicelight": null, "onmsgesturechange": null, "onmsgesturedoubletap": null, "onmsgestureend": null, @@ -509,6 +511,11 @@ "requestAnimationFrame": null } }, + "events": { + "event": [ + "devicelight" + ] + }, "implements": [ "GlobalFetch", "IDBEnvironment", From 3ff43fcd0b3d901c02f32d31cb77e18ec3934f72 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 24 Oct 2020 23:06:45 +0200 Subject: [PATCH 16/20] Remove unimplemented Web Authentication APIs --- baselines/dom.generated.d.ts | 89 --------------------------- baselines/dom.iterable.generated.d.ts | 4 -- inputfiles/knownTypes.json | 1 - inputfiles/removedTypes.json | 4 ++ 4 files changed, 4 insertions(+), 94 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 7cdba2c29..3c4e10d74 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -2,14 +2,6 @@ /// DOM APIs ///////////////////////////// -interface Account { - displayName: string; - id: string; - imageURL?: string; - name?: string; - rpDisplayName: string; -} - interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; @@ -77,13 +69,6 @@ interface AnimationPlaybackEventInit extends EventInit { timelineTime?: number | null; } -interface AssertionOptions { - allowList?: ScopedCredentialDescriptor[]; - extensions?: WebAuthnExtensions; - rpId?: string; - timeoutSeconds?: number; -} - interface AssignedNodesOptions { flatten?: boolean; } @@ -202,15 +187,6 @@ interface ChannelSplitterOptions extends AudioNodeOptions { numberOfOutputs?: number; } -interface ClientData { - challenge: string; - extensions?: WebAuthnExtensions; - hashAlg: string | Algorithm; - origin: string; - rpId: string; - tokenBinding?: string; -} - interface ClientQueryOptions { includeUncontrolled?: boolean; type?: ClientTypes; @@ -1700,24 +1676,6 @@ interface SVGBoundingBoxOptions { stroke?: boolean; } -interface ScopedCredentialDescriptor { - id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null; - transports?: Transport[]; - type: ScopedCredentialType; -} - -interface ScopedCredentialOptions { - excludeList?: ScopedCredentialDescriptor[]; - extensions?: WebAuthnExtensions; - rpId?: string; - timeoutSeconds?: number; -} - -interface ScopedCredentialParameters { - algorithm: string | Algorithm; - type: ScopedCredentialType; -} - interface ScrollIntoViewOptions extends ScrollOptions { block?: ScrollLogicalPosition; inline?: ScrollLogicalPosition; @@ -1939,9 +1897,6 @@ interface WaveShaperOptions extends AudioNodeOptions { oversample?: OverSampleType; } -interface WebAuthnExtensions { -} - interface WebGLContextAttributes { alpha?: boolean; antialias?: boolean; @@ -14685,26 +14640,6 @@ declare var SVGZoomEvent: { new(): SVGZoomEvent; }; -interface ScopedCredential { - readonly id: ArrayBuffer; - readonly type: ScopedCredentialType; -} - -declare var ScopedCredential: { - prototype: ScopedCredential; - new(): ScopedCredential; -}; - -interface ScopedCredentialInfo { - readonly credential: ScopedCredential; - readonly publicKey: CryptoKey; -} - -declare var ScopedCredentialInfo: { - prototype: ScopedCredentialInfo; - new(): ScopedCredentialInfo; -}; - /** A screen, usually the one on which the current window is being rendered, and is obtained using window.screen. */ interface Screen { readonly availHeight: number; @@ -16249,28 +16184,6 @@ declare var WaveShaperNode: { new(context: BaseAudioContext, options?: WaveShaperOptions): WaveShaperNode; }; -interface WebAuthentication { - getAssertion(assertionChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise; -} - -declare var WebAuthentication: { - prototype: WebAuthentication; - new(): WebAuthentication; -}; - -interface WebAuthnAssertion { - readonly authenticatorData: ArrayBuffer; - readonly clientData: ArrayBuffer; - readonly credential: ScopedCredential; - readonly signature: ArrayBuffer; -} - -declare var WebAuthnAssertion: { - prototype: WebAuthnAssertion; - new(): WebAuthnAssertion; -}; - interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase { } @@ -19947,7 +19860,6 @@ type ResidentKeyRequirement = "discouraged" | "preferred" | "required"; type ResizeObserverBoxOptions = "border-box" | "content-box" | "device-pixel-content-box"; type ResizeQuality = "high" | "low" | "medium" | "pixelated"; type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; -type ScopedCredentialType = "ScopedCred"; type ScrollBehavior = "auto" | "smooth"; type ScrollLogicalPosition = "center" | "end" | "nearest" | "start"; type ScrollRestoration = "auto" | "manual"; @@ -19961,7 +19873,6 @@ type SpeechSynthesisErrorCode = "audio-busy" | "audio-hardware" | "canceled" | " type TextTrackKind = "captions" | "chapters" | "descriptions" | "metadata" | "subtitles"; type TextTrackMode = "disabled" | "hidden" | "showing"; type TouchType = "direct" | "stylus"; -type Transport = "ble" | "nfc" | "usb"; type UserVerificationRequirement = "discouraged" | "preferred" | "required"; type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted"; type VideoFacingModeEnum = "environment" | "left" | "right" | "user"; diff --git a/baselines/dom.iterable.generated.d.ts b/baselines/dom.iterable.generated.d.ts index d7787b97d..78fc8a243 100644 --- a/baselines/dom.iterable.generated.d.ts +++ b/baselines/dom.iterable.generated.d.ts @@ -267,10 +267,6 @@ interface WEBGL_draw_buffers { drawBuffersWEBGL(buffers: Iterable): void; } -interface WebAuthentication { - makeCredential(accountInformation: Account, cryptoParameters: Iterable, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise; -} - interface WebGL2RenderingContextBase { clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; diff --git a/inputfiles/knownTypes.json b/inputfiles/knownTypes.json index 8e300b665..607694fec 100644 --- a/inputfiles/knownTypes.json +++ b/inputfiles/knownTypes.json @@ -11,7 +11,6 @@ "BigInteger", "ByteLengthChunk", "CanvasRenderingContext2DSettings", - "ClientData", "ClientQueryOptions", "ClientTypes", "CompositeOperationOrAuto", diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 5108ecdce..8b8226c82 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -306,6 +306,8 @@ } } }, + "ScopedCredential": null, + "ScopedCredentialInfo": null, "ServiceWorkerGlobalScope": { "properties": { "property": { @@ -428,6 +430,8 @@ } } }, + "WebAuthentication": null, + "WebAuthnAssertion": null, "WebGLBuffer": { "extends": null }, From 34e53dd7b8d977e2b3f707fab168b11655c7df31 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 24 Oct 2020 23:38:09 +0200 Subject: [PATCH 17/20] Use BCD to autoremove unimplemented features --- baselines/dom.generated.d.ts | 54 ---- baselines/webworker.generated.d.ts | 1 - inputfiles/overridingTypes.json | 4 - inputfiles/removedTypes.json | 136 +--------- package.json | 1 + src/bcd.ts | 381 +++++++++++++++++++++++++++++ src/index.ts | 4 +- tsconfig.json | 3 +- 8 files changed, 389 insertions(+), 195 deletions(-) create mode 100644 src/bcd.ts diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 3c4e10d74..5a63c9cbe 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -13764,46 +13764,6 @@ declare var SVGNumberList: { interface SVGPathElement extends SVGGraphicsElement { /** @deprecated */ readonly pathSegList: SVGPathSegList; - /** @deprecated */ - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - /** @deprecated */ - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - /** @deprecated */ - createSVGPathSegClosePath(): SVGPathSegClosePath; - /** @deprecated */ - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - /** @deprecated */ - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - /** @deprecated */ - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - /** @deprecated */ - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - /** @deprecated */ - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - /** @deprecated */ - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - /** @deprecated */ - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - /** @deprecated */ - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - /** @deprecated */ - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - /** @deprecated */ - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - /** @deprecated */ - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - /** @deprecated */ - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - /** @deprecated */ - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - /** @deprecated */ - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - /** @deprecated */ - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - /** @deprecated */ - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - /** @deprecated */ - getPathSegAtLength(distance: number): number; getPointAtLength(distance: number): SVGPoint; getTotalLength(): number; addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -14241,25 +14201,11 @@ interface SVGSVGElementEventMap extends SVGElementEventMap { /** Provides access to the properties of elements, as well as methods to manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. */ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan { - /** @deprecated */ - contentScriptType: string; - /** @deprecated */ - contentStyleType: string; currentScale: number; readonly currentTranslate: SVGPoint; readonly height: SVGAnimatedLength; onunload: ((this: SVGSVGElement, ev: Event) => any) | null; onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null; - /** @deprecated */ - readonly pixelUnitToMillimeterX: number; - /** @deprecated */ - readonly pixelUnitToMillimeterY: number; - /** @deprecated */ - readonly screenPixelToMillimeterX: number; - /** @deprecated */ - readonly screenPixelToMillimeterY: number; - /** @deprecated */ - readonly viewport: SVGRect; readonly width: SVGAnimatedLength; readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index ecbb0eb5a..26a7e1d73 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -1545,7 +1545,6 @@ declare var ExtendableMessageEvent: { interface FetchEvent extends ExtendableEvent { readonly clientId: string; readonly preloadResponse: Promise; - readonly replacesClientId: string; readonly request: Request; readonly resultingClientId: string; respondWith(r: Response | Promise): void; diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index 1670a93c6..1aa5eef86 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -1984,10 +1984,6 @@ "name": "push", "type": "PushEvent" }, - { - "name": "pushsubscriptionchange", - "type": "PushSubscriptionChangeEvent" - }, { "name": "sync", "type": "SyncEvent" diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 8b8226c82..4f180afd8 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -34,19 +34,7 @@ } } }, - "XMLHttpRequestEventTarget": null, - "WorkerUtils": { - "methods": { - "method": { - "clearImmediate": null, - "clearInterval": null, - "clearTimeout": null, - "setImmediate": null, - "setInterval": null, - "setTimeout": null - } - } - } + "XMLHttpRequestEventTarget": null } }, "callback-interfaces": { @@ -66,14 +54,12 @@ }, "interfaces": { "interface": { - "AudioTrackList": null, "AuthenticatorAttestationResponse": { "methods": { "method": { "getAuthenticatorData": null, "getPublicKey": null, - "getPublicKeyAlgorithm": null, - "getTransports": null + "getPublicKeyAlgorithm": null } } }, @@ -197,19 +183,11 @@ } } }, - "DeviceLightEvent": null, "ElementInternals": null, "FederatedCredential": null, "FormDataEvent": null, "HTMLAreasCollection": null, - "HTMLBaseFontElement": null, "HTMLMediaElement": { - "properties": { - "property": { - "audioTracks": null, - "videoTracks": null - } - }, "methods": { "method": { "getStartDate": null @@ -236,14 +214,6 @@ } } }, - "MediaStreamTrack": { - "properties": { - "property": { - "isolated": null, - "onisolationchange": null - } - } - }, "MessageEvent": { "methods": { "method": { @@ -254,7 +224,6 @@ "MSCredentials": null, "MSDCCEvent": null, "MSDSHEvent": null, - "MSGestureEvent": null, "MSMediaKeyMessageEvent": null, "MSMediaKeyNeededEvent": null, "MSPointerEvent": null, @@ -262,13 +231,9 @@ "PasswordCredential": null, "Position": null, "PositionError": null, - "PushSubscriptionChangeEvent": null, - "ReadableByteStreamController": null, "ReadableStream": { "iterator": null }, - "ReadableStreamBYOBReader": null, - "ReadableStreamBYOBRequest": null, "ReadableStreamReader": null, "ResizeObservation": null, "ResizeObserverEntry": { @@ -278,36 +243,6 @@ } } }, - "RTCDataChannel": { - "properties": { - "property": { - "onclosing": null - } - } - }, - "RTCIceCandidate": { - "properties": { - "property": { - "address": null - } - } - }, - "RTCIceTransport": { - "properties": { - "property": { - "component": null - } - } - }, - "RTCPeerConnectionIceEvent": { - "properties": { - "property": { - "url": null - } - } - }, - "ScopedCredential": null, - "ScopedCredentialInfo": null, "ServiceWorkerGlobalScope": { "properties": { "property": { @@ -315,7 +250,6 @@ } } }, - "ServiceWorkerMessageEvent": null, "ShadowRoot": { "properties": { "property": { @@ -323,15 +257,6 @@ } } }, - "SourceBuffer": { - "properties": { - "property": { - "audioTracks": null, - "textTracks": null, - "videoTracks": null - } - } - }, "StorageEvent": { "methods": { "method": { @@ -393,44 +318,6 @@ } } }, - "SVGUseElement": { - "properties": { - "property": { - "animatedInstanceRoot": null, - "instanceRoot": null - } - } - }, - "SVGZoomAndPan": null, - "TextMetrics": { - "properties": { - "property": { - "alphabeticBaseline": null, - "emHeightAscent": null, - "emHeightDescent": null, - "fontBoundingBoxAscent": null, - "fontBoundingBoxDescent": null, - "hangingBaseline": null, - "ideographicBaseline": null - } - } - }, - "TextTrack": { - "properties": { - "property": { - "sourceBuffer": null - } - } - }, - "VideoTrackList": null, - "VRPose": { - "properties": { - "property": { - "timestamp": null - } - } - }, - "WebAuthentication": null, "WebAuthnAssertion": null, "WebGLBuffer": { "extends": null @@ -438,7 +325,6 @@ "WebGLFramebuffer": { "extends": null }, - "WebGLObject": null, "WebGLProgram": { "extends": null }, @@ -483,7 +369,6 @@ "crypto": null, "isSecureContext": null, "msCredentials": null, - "ondevicelight": null, "onmsgesturechange": null, "onmsgesturedoubletap": null, "onmsgestureend": null, @@ -503,9 +388,6 @@ "ontouchend": null, "ontouchmove": null, "ontouchstart": null, - "onvrdisplayfocus": null, - "onvrdisplaypointerrestricted": null, - "onvrdisplaypointerunrestricted": null, "performance": null } }, @@ -528,20 +410,6 @@ "WindowConsole" ] }, - "WindowClient": { - "properties": { - "property": { - "ancestorOrigins": null - } - } - }, - "WorkerNavigator": { - "properties": { - "property": { - "serviceWorker": null - } - } - }, "WritableStream": { "methods": { "method": { diff --git a/package.json b/package.json index 1a309116d..72910483e 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "migrate": "node ./lib/migrate-to-tsc.js" }, "dependencies": { + "@mdn/browser-compat-data": "2.0.3", "@types/jsdom": "^16.2.4", "@types/node": "^14.6.4", "@types/node-fetch": "^2.5.7", diff --git a/src/bcd.ts b/src/bcd.ts new file mode 100644 index 000000000..7d1025f61 --- /dev/null +++ b/src/bcd.ts @@ -0,0 +1,381 @@ +import * as Browser from "./types"; +import bcd from "@mdn/browser-compat-data"; +import { Identifier, SimpleSupportStatement, SupportBlock } from "@mdn/browser-compat-data/types"; + +const forceKeepAlive: Record = { + // Things that are incorrectly reported as unsupported. + // These should be filed to https://github.com/mdn/browser-compat-data/issues + "Animation": ["finished", "pending", "ready", "updatePlaybackRate"], + "AnimationPlaybackEvent": ["currentTime", "timelineTime"], + "ByteLengthQueuingStrategy": ["size"], + "ConstantSourceNode": ["offset"], + "CountQueuingStrategy": ["size"], + "CSSSupportsRule": [], + "ExtendableMessageEvent": ["lastEventId", "origin", "ports", "source"], + "GlobalEventHandlers": [ + "onabort", + "oncancel", // Blink only as of Sep 2020 + "ontouchcancel", + "ontouchend", + "ontouchmove", + "ontouchstart" + ], + "HTMLIFrameElement": ["allowPaymentRequest"], + "KeyframeEffect": [ + "composite", + "iterationComposite", // Gecko only as of Sep 2020 + "getKeyframes", + "setKeyframes", + ], + "MediaSource": ["clearLiveSeekableRange", "setLiveSeekableRange"], + "NavigatorPlugins": ["javaEnabled", "mimeTypes", "plugins"], + "RTCDataChannel": ["id", "onerror"], + "SharedWorkerGlobalScope": ["close"], + "ServiceWorkerGlobalScope": ["onmessageerror"], + "SVGSVGElement": ["getCurrentTime", "pauseAnimations", "setCurrentTime", "unpauseAnimations"], + "TextTrackCue": ["endTime", "id", "pauseOnExit", "startTime", "track"], + "TrackEvent": ["track"], + "WebKitCSSMatrix": [], + "WindowEventHandlers": ["onmessage"], + + // Widely supported but without being correctly exposed to global + "DeviceMotionEventAcceleration": ["x", "y", "z"], + "DeviceMotionEventRotationRate": ["alpha", "beta", "gamma"], + "ReadableStreamDefaultReader": ["closed", "cancel", "read", "releaseLock"], + "ReadableStreamDefaultController": ["desiredSize", "close", "enqueue", "error"], + + // Things that indeed are not widely supported enough + // but they already have been in lib.d.ts for a while + "AbstractRange": ["collapsed", "endContainer", "endOffset", "startContainer", "startOffset"], + "AudioContext": ["outputLatency", "createMediaStreamTrackSource"], + "AudioListener": [ + "forwardX", + "forwardY", + "forwardZ", + "positionX", + "positionY", + "positionZ", + "upX", + "upY", + "upZ", + ], + "AudioParam": ["automationRate", "cancelAndHoldAtTime"], + "CaretPosition": [], + "ClipboardItem": [], + "DOMError": ["name"], + "FederatedCredential": [], + "FetchEvent": ["preloadResponse"], + "Gamepad": [ + "hand", + "pose", + "hapticActuators", // widely supported + ], + "GamepadHapticActuator": [ + "type", // widely supported + "pulse", + ], + "GamepadPose": [ + "angularAcceleration", + "angularVelocity", + "hasOrientation", + "hasPosition", + "linearAcceleration", + "linearVelocity", + "orientation", + "position", + ], + "HTMLElement": ["autocapitalize"], + "HTMLCanvasElement": ["transferControlToOffscreen"], + "HTMLDialogElement": ["open", "returnValue", "close", "show", "showModal"], + "InputDeviceInfo": ["getCapabilities"], + "ResizeObserverSize": ["blockSize", "inlineSize"], + "Request": ["keepalive"], + "RTCCertificate": ["getFingerprints"], + "RTCDTMFSender": ["canInsertDTMF"], + "RTCDtlsTransport": [ + "getRemoteCertificates", + "iceTransport", + "onerror", + "onstatechange", + "state", + ], + "RTCError": [], + "RTCErrorEvent": ["error"], + "RTCIceCandidate": [ + "component", + "foundation", + "port", + "priority", + "protocol", + "relatedAddress", + "relatedPort", + "tcpType", + "type", + ], + "RTCIceTransport": [ + "gatheringState", + "getLocalCandidates", + "getLocalParameters", + "getRemoteCandidates", + "getRemoteParameters", + "getSelectedCandidatePair", + "ongatheringstatechange", + "onselectedcandidatepairchange", + "onstatechange", + "role", + "state", + ], + "RTCIdentityAssertion": ["idp", "name"], + "RTCPeerConnection": [ + "canTrickleIceCandidates", // widely supported + "getIdentityAssertion", + "onicecandidateerror", + "peerIdentity", + "setIdentityProvider", + "sctp", + ], + "RTCPeerConnectionIceErrorEvent": ["errorCode", "errorText", "hostCandidate", "url"], + "RTCRtpSender": ["getCapabilities", "rtcpTransport", "transport"], + "RTCRtpTransceiver": ["setCodecPreferences"], + "RTCSctpTransport": [ + "maxChannels", + "maxMessageSize", + "onstatechange", + "state", + "transport", + ], + "RTCStatsReport": [], + "MediaStreamTrackAudioSourceNode": [], + "NavigationPreloadManager": ["disable", "enable", "getState", "setHeaderValue"], + "Notification": [ + "actions", + "badge", + "image", + "maxActions", + "renotify", + "requireInteraction", + "silent", + "timestamp", + "vibrate", + ], + "OfflineAudioContext": [ + "resume", // widely supported + "suspend", + ], + "OffscreenCanvas": [ + "convertToBlob", + "getContext", + "height", + "transferToImageBitmap", + "width", + ], + "PasswordCredential": [], + "PushSubscription": ["expirationTime"], + "PushSubscriptionOptions" : ["userVisibleOnly"], + "ServiceWorkerRegistration": ["sync"], + "SpeechGrammar": ["src", "weight"], + "SpeechGrammarList": ["addFromString", "addFromURI", "item", "length"], + "SpeechRecognition": [ + "abort", + "continuous", + "grammars", + "interimResults", + "lang", + "maxAlternatives", + "onaudioend", + "onaudiostart", + "onend", + "onerror", + "onnomatch", + "onresult", + "onsoundend", + "onsoundstart", + "onspeechend", + "onspeechstart", + "onstart", + "start", + "stop", + ], + "SpeechRecognitionAlternative": ["confidence", "transcript"], + "SpeechRecognitionErrorEvent": ["error", "message"], + "SpeechRecognitionEvent": ["resultIndex", "results"], + "SpeechRecognitionResult": ["item", "length", "isFinal"], + "SpeechRecognitionResultList": ["item", "length"], + "SyncManager": ["getTags", "register"], + "SyncEvent": ["lastChance", "tag"], + "TextDecoderStream": [], + "TextEncoderStream": [], + "TransformStream": ["readable", "writable"], + "TransformStreamDefaultController": ["desiredSize", "enqueue", "error", "terminate"], + "VRDisplay": [ + "cancelAnimationFrame", + "capabilities", + "depthFar", + "depthNear", + "displayId", + "displayName", + "exitPresent", + "getEyeParameters", + "getFrameData", + "getLayers", + "getPose", + "isConnected", + "isPresenting", + "requestAnimationFrame", + "requestPresent", + "resetPose", + "stageParameters", + "submitFrame", + ], + "VRDisplayCapabilities": [ + "canPresent", + "hasExternalDisplay", + "hasOrientation", + "hasPosition", + "maxLayers", + ], + "VRDisplayEvent": ["display", "reason"], + "VREyeParameters": [ + "fieldOfView", + "offset", + "renderHeight", + "renderWidth", + ], + "VRFieldOfView": ["downDegrees", "leftDegrees", "rightDegrees", "upDegrees"], + "VRFrameData": [ + "leftProjectionMatrix", + "leftViewMatrix", + "pose", + "rightProjectionMatrix", + "rightViewMatrix", + "timestamp", + ], + "VRPose": [ + "angularAcceleration", + "angularVelocity", + "linearAcceleration", + "linearVelocity", + "orientation", + "position", + ], + "VTTCue": ["lineAlign", "positionAlign", "region"], + "WebGLVertexArrayObjectOES": [], + "Window": [ + "ondeviceorientationabsolute", + "onvrdisplayactivate", + "onvrdisplayblur", + "onvrdisplaydeactivate", + "onvrdisplaypresentchange" + ], + "WorkerNavigator": ["permissions"], + "WritableStream": ["abort", "getWriter", "locked"], + "WritableStreamDefaultController": ["error"], + "WritableStreamDefaultWriter": [ + "abort", + "close", + "closed", + "desiredSize", + "ready", + "releaseLock", + "write", + ], +}; + +function hasMultipleImplementations(support: SupportBlock) { + function hasStableImplementation(browser: SimpleSupportStatement | SimpleSupportStatement[] | undefined) { + if (!browser) { + return false; + } + const latest = Array.isArray(browser) ? browser[0] : browser; + return latest.version_added && !latest.version_removed && !latest.flags; + } + let count = 0; + if (hasStableImplementation(support.chrome) || hasStableImplementation(support.chrome_android)) { + count += 1; + } + if (hasStableImplementation(support.firefox) || hasStableImplementation(support.firefox_android)) { + count += 1; + } + if (hasStableImplementation(support.safari) || hasStableImplementation(support.safari_ios)) { + count += 1; + } + return count >= 2; +} + +function isEmpty(o: object) { + return !Object.keys(o).length; +} + +function isSuitable(key: string, value: Identifier, parentKey?: string) { + const forceAlive = parentKey ? forceKeepAlive[parentKey]?.includes(key) : !!forceKeepAlive[key]; + if (value.__compat && hasMultipleImplementations(value.__compat.support)) { + if (forceAlive) { + if (parentKey) { + console.warn(`Redundant forceKeepAlive item: ${parentKey}#${key}`) + } else if (!forceKeepAlive[key].length) { + console.warn(`Redundant forceKeepAlive item: ${key}`) + } + } + return true; + } + return forceAlive; +} + +export function getRemovalDataFromBcd(webidl: Browser.WebIdl) { + function getDefinition(key: string) { + if (webidl.interfaces!.interface.hasOwnProperty(key)) { + return { + type: "interface", + base: webidl.interfaces!.interface[key] + }; + } else if (webidl.mixins!.mixin.hasOwnProperty(key)) { + return { + type: "mixin", + base: webidl.mixins!.mixin[key] + }; + } + } + + const interfaces: Record = {}; + const mixins: Record = {}; + for (const [key, value] of Object.entries(bcd.api)) { + const definition = getDefinition(key); + if (!definition) { + continue; + } + const { base } = definition + if (!isSuitable(key, value)) { + if (definition.type === "interface") { + interfaces[key] = { exposed: "" }; + } + continue; + } + + const methods: Record = {}; + const properties: Record = {}; + for (const [memberKey, memberValue] of Object.entries(value)) { + if (!isSuitable(memberKey, memberValue, key)) { + if (base.methods.method.hasOwnProperty(memberKey)) { + methods[memberKey] = { exposed: "" }; + } else if (base.properties!.property.hasOwnProperty(memberKey)) { + properties[memberKey] = { exposed: "" }; + } + } + } + const removalItem: Record = {}; + if (!isEmpty(methods)) { + removalItem.methods = { method: methods }; + } + if (!isEmpty(properties)) { + removalItem.properties = { property: properties }; + } + if (!isEmpty(removalItem)) { + if (definition.type === "interface") { + interfaces[key] = removalItem; + } else { + mixins[key] = removalItem; + } + } + } + return { interfaces: { interface: interfaces }, mixins: { mixin: mixins } }; +} diff --git a/src/index.ts b/src/index.ts index 0ca747531..867bb9854 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import { merge, resolveExposure, markAsDeprecated, mapToArray, arrayToMap } from import { Flavor, emitWebIdl } from "./emitter"; import { convert } from "./widlprocess"; import { getExposedTypes } from "./expose"; +import { getRemovalDataFromBcd } from "./bcd"; function mergeNamesakes(filtered: Browser.WebIdl) { const targets = [ @@ -187,6 +188,7 @@ function emitDom() { } } + webidl = merge(webidl, getRemovalDataFromBcd(webidl) as any); webidl = prune(webidl, removedItems); webidl = mergeApiDescriptions(webidl, documentationFromMDN); webidl = merge(webidl, addedItems); @@ -210,7 +212,7 @@ function emitDom() { if (!template) return obj; const filtered = { ...obj }; for (const k in template) { - if (!obj[k]) { + if (!obj[k] || obj[k].exposed === "") { console.warn(`removedTypes.json has a redundant field ${k} in ${JSON.stringify(template)}`); } else if (Array.isArray(template[k])) { if (!Array.isArray(obj[k])) { diff --git a/tsconfig.json b/tsconfig.json index 1d92daf0d..4c79bf29e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ "esModuleInterop": true, "sourceMap": true, "noUnusedLocals": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "resolveJsonModule": true }, "include": [ "./src" From 192d51939181064a6878e2aaa9d5290f28912047 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 5 Nov 2020 19:26:44 +0100 Subject: [PATCH 18/20] bcd 2.0.5 --- package.json | 2 +- src/bcd.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 72910483e..802dd552e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "migrate": "node ./lib/migrate-to-tsc.js" }, "dependencies": { - "@mdn/browser-compat-data": "2.0.3", + "@mdn/browser-compat-data": "2.0.5", "@types/jsdom": "^16.2.4", "@types/node": "^14.6.4", "@types/node-fetch": "^2.5.7", diff --git a/src/bcd.ts b/src/bcd.ts index 7d1025f61..ec1d824a1 100644 --- a/src/bcd.ts +++ b/src/bcd.ts @@ -10,7 +10,6 @@ const forceKeepAlive: Record = { "ByteLengthQueuingStrategy": ["size"], "ConstantSourceNode": ["offset"], "CountQueuingStrategy": ["size"], - "CSSSupportsRule": [], "ExtendableMessageEvent": ["lastEventId", "origin", "ports", "source"], "GlobalEventHandlers": [ "onabort", From c3eef9ea6b780d9b761b197ac8acf3a715668dfa Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 12 Nov 2020 19:19:31 +0100 Subject: [PATCH 19/20] bcd 2.0.6 --- package.json | 2 +- src/bcd.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 802dd552e..ef8eacd58 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "migrate": "node ./lib/migrate-to-tsc.js" }, "dependencies": { - "@mdn/browser-compat-data": "2.0.5", + "@mdn/browser-compat-data": "2.0.6", "@types/jsdom": "^16.2.4", "@types/node": "^14.6.4", "@types/node-fetch": "^2.5.7", diff --git a/src/bcd.ts b/src/bcd.ts index ec1d824a1..4ad45e552 100644 --- a/src/bcd.ts +++ b/src/bcd.ts @@ -28,7 +28,6 @@ const forceKeepAlive: Record = { ], "MediaSource": ["clearLiveSeekableRange", "setLiveSeekableRange"], "NavigatorPlugins": ["javaEnabled", "mimeTypes", "plugins"], - "RTCDataChannel": ["id", "onerror"], "SharedWorkerGlobalScope": ["close"], "ServiceWorkerGlobalScope": ["onmessageerror"], "SVGSVGElement": ["getCurrentTime", "pauseAnimations", "setCurrentTime", "unpauseAnimations"], @@ -89,8 +88,6 @@ const forceKeepAlive: Record = { "InputDeviceInfo": ["getCapabilities"], "ResizeObserverSize": ["blockSize", "inlineSize"], "Request": ["keepalive"], - "RTCCertificate": ["getFingerprints"], - "RTCDTMFSender": ["canInsertDTMF"], "RTCDtlsTransport": [ "getRemoteCertificates", "iceTransport", @@ -134,7 +131,7 @@ const forceKeepAlive: Record = { "sctp", ], "RTCPeerConnectionIceErrorEvent": ["errorCode", "errorText", "hostCandidate", "url"], - "RTCRtpSender": ["getCapabilities", "rtcpTransport", "transport"], + "RTCRtpSender": ["rtcpTransport", "transport"], "RTCRtpTransceiver": ["setCodecPreferences"], "RTCSctpTransport": [ "maxChannels", From 555d3d57a18037c12bd9f54e1c0b06701e7b83b7 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 21 Nov 2020 22:06:06 +0100 Subject: [PATCH 20/20] 2.0.7 --- inputfiles/removedTypes.json | 1 + package.json | 2 +- src/bcd.ts | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 4f180afd8..7cd5f4847 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -318,6 +318,7 @@ } } }, + "WebAuthentication": null, "WebAuthnAssertion": null, "WebGLBuffer": { "extends": null diff --git a/package.json b/package.json index ef8eacd58..8286fe819 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "migrate": "node ./lib/migrate-to-tsc.js" }, "dependencies": { - "@mdn/browser-compat-data": "2.0.6", + "@mdn/browser-compat-data": "2.0.7", "@types/jsdom": "^16.2.4", "@types/node": "^14.6.4", "@types/node-fetch": "^2.5.7", diff --git a/src/bcd.ts b/src/bcd.ts index 4ad45e552..e903ee6ad 100644 --- a/src/bcd.ts +++ b/src/bcd.ts @@ -30,15 +30,12 @@ const forceKeepAlive: Record = { "NavigatorPlugins": ["javaEnabled", "mimeTypes", "plugins"], "SharedWorkerGlobalScope": ["close"], "ServiceWorkerGlobalScope": ["onmessageerror"], - "SVGSVGElement": ["getCurrentTime", "pauseAnimations", "setCurrentTime", "unpauseAnimations"], "TextTrackCue": ["endTime", "id", "pauseOnExit", "startTime", "track"], "TrackEvent": ["track"], "WebKitCSSMatrix": [], "WindowEventHandlers": ["onmessage"], // Widely supported but without being correctly exposed to global - "DeviceMotionEventAcceleration": ["x", "y", "z"], - "DeviceMotionEventRotationRate": ["alpha", "beta", "gamma"], "ReadableStreamDefaultReader": ["closed", "cancel", "read", "releaseLock"], "ReadableStreamDefaultController": ["desiredSize", "close", "enqueue", "error"],