Skip to content

Commit 7697691

Browse files
committed
Merge pull request #85 from FranklinWhale/Better-NS
Add signature overloads for XHTML and SVG namespaces
2 parents 2709769 + 84f04e7 commit 7697691

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

baselines/dom.generated.d.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -2865,6 +2865,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
28652865
createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement;
28662866
createElement(tagName: "xmp"): HTMLPreElement;
28672867
createElement(tagName: string): HTMLElement;
2868+
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement
28682869
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement
28692870
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement
28702871
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement
@@ -2988,7 +2989,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
29882989
* @param elementId String that specifies the ID value. Case-insensitive.
29892990
*/
29902991
getElementById(elementId: string): HTMLElement;
2991-
getElementsByClassName(classNames: string): NodeListOf<Element>;
2992+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
29922993
/**
29932994
* Gets a collection of objects based on the value of the NAME or ID attribute.
29942995
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -3175,7 +3176,9 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
31753176
getElementsByTagName(tagname: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
31763177
getElementsByTagName(tagname: "xmp"): NodeListOf<HTMLPreElement>;
31773178
getElementsByTagName(tagname: string): NodeListOf<Element>;
3178-
getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>;
3179+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
3180+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
3181+
getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;
31793182
/**
31803183
* Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
31813184
*/
@@ -3643,7 +3646,9 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
36433646
getElementsByTagName(name: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
36443647
getElementsByTagName(name: "xmp"): NodeListOf<HTMLPreElement>;
36453648
getElementsByTagName(name: string): NodeListOf<Element>;
3646-
getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>;
3649+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
3650+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
3651+
getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;
36473652
hasAttribute(name: string): boolean;
36483653
hasAttributeNS(namespaceURI: string, localName: string): boolean;
36493654
msGetRegionContent(): MSRangeCollection;

inputfiles/addedTypes.json

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
"name": "createElementNS",
221221
"interface": "Document",
222222
"signatures": [
223+
"createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement",
223224
"createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement",
224225
"createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement",
225226
"createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement",

inputfiles/overridingTypes.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@
107107
{
108108
"kind": "method",
109109
"name": "getElementsByTagNameNS",
110-
"signatures": ["getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>"]
110+
"signatures": [
111+
"getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf<HTMLElement>",
112+
"getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf<SVGElement>",
113+
"getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>"
114+
]
111115
},
112116
{
113117
"kind": "method",
114118
"name": "getElementsByClassName",
115-
"signatures": ["getElementsByClassName(classNames: string): NodeListOf<Element>"]
119+
"signatures": ["getElementsByClassName(classNames: string): HTMLCollectionOf<Element>"]
116120
},
117121
{
118122
"kind": "method",

0 commit comments

Comments
 (0)