Skip to content

Commit 2c5ddea

Browse files
author
Orta Therox
authored
Merge pull request #970 from microsoft/revert-885-master
Reverts #885 - dom query changes
2 parents d801bc2 + c81fa76 commit 2c5ddea

File tree

3 files changed

+12
-88
lines changed

3 files changed

+12
-88
lines changed

baselines/dom.generated.d.ts

+7-11
Original file line numberDiff line numberDiff line change
@@ -4830,11 +4830,11 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
48304830
* Returns a reference to the first object with the specified value of the ID attribute.
48314831
* @param elementId String that specifies the ID value.
48324832
*/
4833-
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
4833+
getElementById(elementId: string): HTMLElement | null;
48344834
/**
48354835
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
48364836
*/
4837-
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
4837+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
48384838
/**
48394839
* Gets a collection of objects based on the value of the NAME or ID attribute.
48404840
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -5030,7 +5030,7 @@ interface DocumentEvent {
50305030
/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */
50315031
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
50325032
readonly ownerDocument: Document;
5033-
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
5033+
getElementById(elementId: string): HTMLElement | null;
50345034
}
50355035

50365036
declare var DocumentFragment: {
@@ -5216,7 +5216,7 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
52165216
/**
52175217
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
52185218
*/
5219-
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
5219+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
52205220
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
52215221
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
52225222
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
@@ -6671,7 +6671,6 @@ interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementC
66716671
readonly offsetParent: Element | null;
66726672
readonly offsetTop: number;
66736673
readonly offsetWidth: number;
6674-
readonly parentElement: HTMLElement | null;
66756674
spellcheck: boolean;
66766675
title: string;
66776676
translate: boolean;
@@ -10865,7 +10864,7 @@ interface Node extends EventTarget {
1086510864
/**
1086610865
* Returns the parent element.
1086710866
*/
10868-
readonly parentElement: Element | null;
10867+
readonly parentElement: HTMLElement | null;
1086910868
/**
1087010869
* Returns the parent.
1087110870
*/
@@ -11123,7 +11122,7 @@ interface NonElementParentNode {
1112311122
/**
1112411123
* Returns the first element within node's descendants whose ID is elementId.
1112511124
*/
11126-
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
11125+
getElementById(elementId: string): Element | null;
1112711126
}
1112811127

1112911128
interface NotificationEventMap {
@@ -13052,9 +13051,7 @@ interface SVGElement extends Element, DocumentAndElementEventHandlers, DocumentA
1305213051
/** @deprecated */
1305313052
readonly className: any;
1305413053
readonly ownerSVGElement: SVGSVGElement | null;
13055-
readonly parentElement: SVGElement | null;
1305613054
readonly viewportElement: SVGElement | null;
13057-
getElementsByClassName<E extends Element = SVGElement>(classNames: string): HTMLCollectionOf<E>;
1305813055
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1305913056
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1306013057
removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -13642,7 +13639,6 @@ interface SVGForeignObjectElement extends SVGGraphicsElement {
1364213639
readonly width: SVGAnimatedLength;
1364313640
readonly x: SVGAnimatedLength;
1364413641
readonly y: SVGAnimatedLength;
13645-
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
1364613642
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1364713643
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1364813644
removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -14446,7 +14442,7 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB
1444614442
forceRedraw(): void;
1444714443
getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;
1444814444
getCurrentTime(): number;
14449-
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
14445+
getElementById(elementId: string): Element;
1445014446
getEnclosureList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
1445114447
getIntersectionList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
1445214448
pauseAnimations(): void;

inputfiles/addedTypes.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@
626626
"getElementsByClassName": {
627627
"name": "getElementsByClassName",
628628
"override-signatures": [
629-
"getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>"
629+
"getElementsByClassName(classNames: string): HTMLCollectionOf<Element>"
630630
]
631631
},
632632
"closest": {
@@ -988,7 +988,7 @@
988988
"name": "getElementById",
989989
"exposed": "Window",
990990
"override-signatures": [
991-
"getElementById<E extends Element = HTMLElement>(elementId: string): E | null"
991+
"getElementById(elementId: string): HTMLElement | null"
992992
]
993993
}
994994
}

inputfiles/overridingTypes.json

+3-75
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
{
22
"mixins": {
33
"mixin": {
4-
"NonElementParentNode": {
5-
"name": "NonElementParentNode",
6-
"methods": {
7-
"method": {
8-
"getElementById": {
9-
"name": "getElementById",
10-
"override-signatures": [
11-
"getElementById<E extends Element = HTMLElement>(elementId: string): E | null"
12-
]
13-
}
14-
}
15-
}
16-
},
17-
"GlobalFetch": {
18-
"name": "GlobalFetch",
19-
"methods": {
20-
"method": {
21-
"fetch": {
22-
"name": "fetch",
23-
"override-signatures": [
24-
"fetch(input: RequestInfo, init?: RequestInit): Promise<Response>"
25-
]
26-
}
27-
}
28-
}
29-
},
304
"Animatable": {
315
"name": "Animatable",
326
"methods": {
@@ -528,18 +502,6 @@
528502
},
529503
"override-index-signatures": []
530504
},
531-
"HTMLElement": {
532-
"name": "HTMLElement",
533-
"properties": {
534-
"property": {
535-
"parentElement": {
536-
"name": "parentElement",
537-
"read-only": 1,
538-
"override-type": "HTMLElement | null"
539-
}
540-
}
541-
}
542-
},
543505
"Document": {
544506
"name": "Document",
545507
"methods": {
@@ -565,7 +527,7 @@
565527
"getElementById": {
566528
"name": "getElementById",
567529
"override-signatures": [
568-
"getElementById<E extends Element = HTMLElement>(elementId: string): E | null"
530+
"getElementById(elementId: string): HTMLElement | null"
569531
]
570532
},
571533
"getElementsByTagNameNS": {
@@ -579,7 +541,7 @@
579541
"getElementsByClassName": {
580542
"name": "getElementsByClassName",
581543
"override-signatures": [
582-
"getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>"
544+
"getElementsByClassName(classNames: string): HTMLCollectionOf<Element>"
583545
]
584546
},
585547
"getElementsByName": {
@@ -728,7 +690,7 @@
728690
"override-type": "Node & ParentNode | null"
729691
},
730692
"parentElement": {
731-
"override-type": "Element | null"
693+
"override-type": "HTMLElement | null"
732694
},
733695
"childNodes": {
734696
"override-type": "NodeListOf<ChildNode>"
@@ -939,21 +901,6 @@
939901
"deprecated": 1,
940902
"name": "className",
941903
"type": "any"
942-
},
943-
"parentElement": {
944-
"name": "parentElement",
945-
"read-only": 1,
946-
"override-type": "SVGElement | null"
947-
}
948-
}
949-
},
950-
"methods": {
951-
"method": {
952-
"getElementsByClassName": {
953-
"name": "getElementsByClassName",
954-
"override-signatures": [
955-
"getElementsByClassName<E extends Element = SVGElement>(classNames: string): HTMLCollectionOf<E>"
956-
]
957904
}
958905
}
959906
}
@@ -962,12 +909,6 @@
962909
"name": "SVGSVGElement",
963910
"methods": {
964911
"method": {
965-
"getElementById": {
966-
"name": "getElementById",
967-
"override-signatures": [
968-
"getElementById<E extends Element = HTMLElement>(elementId: string): E | null"
969-
]
970-
},
971912
"getEnclosureList": {
972913
"name": "getEnclosureList",
973914
"override-signatures": [
@@ -999,19 +940,6 @@
999940
}
1000941
}
1001942
},
1002-
"SVGForeignObjectElement": {
1003-
"name": "SVGForeignObjectElement",
1004-
"methods": {
1005-
"method": {
1006-
"getElementsByClassName": {
1007-
"name": "getElementsByClassName",
1008-
"override-signatures": [
1009-
"getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>"
1010-
]
1011-
}
1012-
}
1013-
}
1014-
},
1015943
"FormData": {
1016944
"name": "FormData",
1017945
"methods": {

0 commit comments

Comments
 (0)