Skip to content

Commit 0b7c8ce

Browse files
Make ChildNode and ParentNode extend Node again (#1088)
* Updated overridingTypes for ChildNode and ParentNode. * Accept baselines. * Restore overrides. * Accepted baselines. * Remove unnecessary 'name' fields.
1 parent 12289de commit 0b7c8ce

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

baselines/dom.generated.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,7 @@ declare var CharacterData: {
34633463
new(): CharacterData;
34643464
};
34653465

3466-
interface ChildNode {
3466+
interface ChildNode extends Node {
34673467
/**
34683468
* Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
34693469
*
@@ -10471,23 +10471,23 @@ interface Node extends EventTarget {
1047110471
/**
1047210472
* Returns the children.
1047310473
*/
10474-
readonly childNodes: NodeListOf<ChildNode & Node>;
10474+
readonly childNodes: NodeListOf<ChildNode>;
1047510475
/**
1047610476
* Returns the first child.
1047710477
*/
10478-
readonly firstChild: (ChildNode & Node) | null;
10478+
readonly firstChild: ChildNode | null;
1047910479
/**
1048010480
* Returns true if node is connected and false otherwise.
1048110481
*/
1048210482
readonly isConnected: boolean;
1048310483
/**
1048410484
* Returns the last child.
1048510485
*/
10486-
readonly lastChild: (ChildNode & Node) | null;
10486+
readonly lastChild: ChildNode | null;
1048710487
/**
1048810488
* Returns the next sibling.
1048910489
*/
10490-
readonly nextSibling: (ChildNode & Node) | null;
10490+
readonly nextSibling: ChildNode | null;
1049110491
/**
1049210492
* Returns a string appropriate for the type of node.
1049310493
*/
@@ -10508,11 +10508,11 @@ interface Node extends EventTarget {
1050810508
/**
1050910509
* Returns the parent.
1051010510
*/
10511-
readonly parentNode: (Node & ParentNode) | null;
10511+
readonly parentNode: ParentNode | null;
1051210512
/**
1051310513
* Returns the previous sibling.
1051410514
*/
10515-
readonly previousSibling: (ChildNode & Node) | null;
10515+
readonly previousSibling: ChildNode | null;
1051610516
textContent: string | null;
1051710517
appendChild<T extends Node>(node: T): T;
1051810518
/**
@@ -10929,7 +10929,7 @@ declare var PannerNode: {
1092910929
new(context: BaseAudioContext, options?: PannerOptions): PannerNode;
1093010930
};
1093110931

10932-
interface ParentNode {
10932+
interface ParentNode extends Node {
1093310933
readonly childElementCount: number;
1093410934
/**
1093510935
* Returns the child elements.

inputfiles/overridingTypes.jsonc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"mixins": {
33
"mixin": {
4+
"ChildNode": {
5+
"extends": "Node"
6+
},
7+
"ParentNode": {
8+
"extends": "Node"
9+
},
410
"Animatable": {
511
"methods": {
612
"method": {
@@ -754,25 +760,25 @@
754760
"properties": {
755761
"property": {
756762
"parentNode": {
757-
"overrideType": "Node & ParentNode"
763+
"overrideType": "ParentNode"
758764
},
759765
"parentElement": {
760766
"overrideType": "HTMLElement"
761767
},
762768
"childNodes": {
763-
"overrideType": "NodeListOf<ChildNode & Node>"
769+
"overrideType": "NodeListOf<ChildNode>"
764770
},
765771
"firstChild": {
766-
"overrideType": "ChildNode & Node"
772+
"overrideType": "ChildNode"
767773
},
768774
"lastChild": {
769-
"overrideType": "ChildNode & Node"
775+
"overrideType": "ChildNode"
770776
},
771777
"nextSibling": {
772-
"overrideType": "ChildNode & Node"
778+
"overrideType": "ChildNode"
773779
},
774780
"previousSibling": {
775-
"overrideType": "ChildNode & Node"
781+
"overrideType": "ChildNode"
776782
}
777783
}
778784
}

0 commit comments

Comments
 (0)