diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 8fd89ce50..53a3c6c5b 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -4366,10 +4366,6 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par */ createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; @@ -17728,6 +17724,7 @@ interface HTMLElementDeprecatedTagNameMap { } interface SVGElementTagNameMap { + "a": SVGAElement; "circle": SVGCircleElement; "clipPath": SVGClipPathElement; "defs": SVGDefsElement; @@ -17772,19 +17769,22 @@ interface SVGElementTagNameMap { "polyline": SVGPolylineElement; "radialGradient": SVGRadialGradientElement; "rect": SVGRectElement; + "script": SVGScriptElement; "stop": SVGStopElement; + "style": SVGStyleElement; "svg": SVGSVGElement; "switch": SVGSwitchElement; "symbol": SVGSymbolElement; "text": SVGTextElement; "textPath": SVGTextPathElement; + "title": SVGTitleElement; "tspan": SVGTSpanElement; "use": SVGUseElement; "view": SVGViewElement; } /** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ -interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } +type ElementTagNameMap = HTMLElementTagNameMap & Pick>; declare var Audio: { new(src?: string): HTMLAudioElement; diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index e87fdfd44..10a1da38f 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -718,10 +718,6 @@ "additional-signatures": [ "createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement", "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: K): SVGElementTagNameMap[K]", - "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement", - "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement", - "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement", - "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement", "createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement", "createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element" ] diff --git a/src/emitter.ts b/src/emitter.ts index 2f7ef1834..1873acc1b 100644 --- a/src/emitter.ts +++ b/src/emitter.ts @@ -456,11 +456,6 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) { printer.printLine("interface SVGElementTagNameMap {"); printer.increaseIndent(); for (const [e, value] of Object.entries(tagNameToEleName.svgResult).sort()) { - if (e in tagNameToEleName.htmlResult) { - // Skip conflicting fields with HTMLElementTagNameMap - // to be compatible with deprecated ElementTagNameMap - continue; - } printer.printLine(`"${e}": ${value};`); } printer.decreaseIndent(); @@ -470,7 +465,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) { function emitElementTagNameMap() { printer.printLine("/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */"); - printer.printLine("interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }"); + printer.printLine("type ElementTagNameMap = HTMLElementTagNameMap & Pick>;"); printer.printLine(""); }