diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 19c6a7935..f1c34c8ac 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -9348,10 +9348,6 @@ declare var IDBDatabase: { new(): IDBDatabase; }; -interface IDBEnvironment { - readonly indexedDB: IDBFactory; -} - /** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */ interface IDBFactory { /** @@ -18533,12 +18529,10 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler } /** A window containing a DOM document; the document property points to the DOM document loaded in that window. */ -interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage { +interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage { readonly applicationCache: ApplicationCache; - readonly caches: CacheStorage; readonly clientInformation: Navigator; readonly closed: boolean; - readonly crypto: Crypto; customElements: CustomElementRegistry; defaultStatus: string; readonly devicePixelRatio: number; @@ -18603,7 +18597,6 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler readonly pageXOffset: number; readonly pageYOffset: number; readonly parent: Window; - readonly performance: Performance; readonly personalbar: BarProp; readonly screen: Screen; readonly screenLeft: number; @@ -18667,11 +18660,6 @@ declare var Window: { new(): Window; }; -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - interface WindowConsole { readonly console: Console; } @@ -19533,10 +19521,8 @@ declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; declare var applicationCache: ApplicationCache; -declare var caches: CacheStorage; declare var clientInformation: Navigator; declare var closed: boolean; -declare var crypto: Crypto; declare var customElements: CustomElementRegistry; declare var defaultStatus: string; declare var devicePixelRatio: number; @@ -19601,7 +19587,6 @@ declare var outerWidth: number; declare var pageXOffset: number; declare var pageYOffset: number; declare var parent: Window; -declare var performance: Performance; declare var personalbar: BarProp; declare var screen: Screen; declare var screenLeft: number; @@ -19926,9 +19911,6 @@ declare var onvolumechange: ((this: Window, ev: Event) => any) | null; */ declare var onwaiting: ((this: Window, ev: Event) => any) | null; declare var onwheel: ((this: Window, ev: WheelEvent) => any) | null; -declare var indexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; declare function cancelAnimationFrame(handle: number): void; declare function requestAnimationFrame(callback: FrameRequestCallback): number; declare var caches: CacheStorage; @@ -19946,8 +19928,6 @@ declare function fetch(input: RequestInfo, init?: RequestInit): Promise any) | null; declare var onbeforeprint: ((this: Window, ev: Event) => any) | null; declare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null; diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 7f8330620..9ac2f163e 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -296,10 +296,7 @@ } } }, - "extends": "SVGElement", - "implements": [ - "SVGFilterPrimitiveStandardAttributes" - ] + "extends": "SVGElement" }, "AbortSignal": { "events": { @@ -1063,9 +1060,7 @@ }, "SVGElement": { "implements": [ - "ElementCSSInlineStyle", - "GlobalEventHandlers", - "DocumentAndElementEventHandlers" + "ElementCSSInlineStyle" ] }, "Text": { diff --git a/inputfiles/removedTypes.json b/inputfiles/removedTypes.json index 174885a7e..f2503bb34 100644 --- a/inputfiles/removedTypes.json +++ b/inputfiles/removedTypes.json @@ -313,11 +313,14 @@ "properties": { "property": { "browser": null, + "caches": null, + "crypto": null, "msCredentials": null, "ontouchcancel": null, "ontouchend": null, "ontouchmove": null, - "ontouchstart": null + "ontouchstart": null, + "performance": null } }, "methods": { @@ -328,6 +331,8 @@ }, "implements": [ "GlobalFetch", + "IDBEnvironment", + "WindowBase64", "WindowTimers" ] }, diff --git a/src/emitter.ts b/src/emitter.ts index 144ba91a5..72c4bfb67 100644 --- a/src/emitter.ts +++ b/src/emitter.ts @@ -870,9 +870,10 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) { printer.print(`interface ${getNameWithTypeParameter(i, processedIName)}`); - const finalExtends = distinct([i.extends || "Object"].concat((i.implements || []).sort()) + const finalExtends = [i.extends || "Object"] + .concat((i.implements || []).sort()) .filter(i => i !== "Object") - .map(processIName)); + .map(processIName); if (finalExtends.length) { printer.print(` extends ${finalExtends.join(", ")}`); diff --git a/src/index.ts b/src/index.ts index e16e2998c..0da4f6e6c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -166,11 +166,12 @@ function emitDom() { for (const include of w.includes) { const target = webidl.interfaces!.interface[include.target]; if (target) { - if (target.implements) { - target.implements.push(include.includes); - } - else { + if (!target.implements) { target.implements = [include.includes]; + } else if (!target.implements.includes(include.includes)) { + // This makes sure that browser.webidl.preprocessed.json + // does not already have the mixin reference + target.implements.push(include.includes); } } }