Skip to content

Make ChildNode and ParentNode extend Node again #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3463,7 +3463,7 @@ declare var CharacterData: {
new(): CharacterData;
};

interface ChildNode {
interface ChildNode extends Node {
/**
* Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
*
Expand Down Expand Up @@ -10471,23 +10471,23 @@ interface Node extends EventTarget {
/**
* Returns the children.
*/
readonly childNodes: NodeListOf<ChildNode & Node>;
readonly childNodes: NodeListOf<ChildNode>;
/**
* Returns the first child.
*/
readonly firstChild: (ChildNode & Node) | null;
readonly firstChild: ChildNode | null;
/**
* Returns true if node is connected and false otherwise.
*/
readonly isConnected: boolean;
/**
* Returns the last child.
*/
readonly lastChild: (ChildNode & Node) | null;
readonly lastChild: ChildNode | null;
/**
* Returns the next sibling.
*/
readonly nextSibling: (ChildNode & Node) | null;
readonly nextSibling: ChildNode | null;
/**
* Returns a string appropriate for the type of node.
*/
Expand All @@ -10508,11 +10508,11 @@ interface Node extends EventTarget {
/**
* Returns the parent.
*/
readonly parentNode: (Node & ParentNode) | null;
readonly parentNode: ParentNode | null;
/**
* Returns the previous sibling.
*/
readonly previousSibling: (ChildNode & Node) | null;
readonly previousSibling: ChildNode | null;
textContent: string | null;
appendChild<T extends Node>(node: T): T;
/**
Expand Down Expand Up @@ -10929,7 +10929,7 @@ declare var PannerNode: {
new(context: BaseAudioContext, options?: PannerOptions): PannerNode;
};

interface ParentNode {
interface ParentNode extends Node {
readonly childElementCount: number;
/**
* Returns the child elements.
Expand Down
18 changes: 12 additions & 6 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"mixins": {
"mixin": {
"ChildNode": {
"extends": "Node"
},
"ParentNode": {
"extends": "Node"
},
"Animatable": {
"name": "Animatable",
"methods": {
Expand Down Expand Up @@ -761,25 +767,25 @@
"properties": {
"property": {
"parentNode": {
"overrideType": "Node & ParentNode"
"overrideType": "ParentNode"
},
"parentElement": {
"overrideType": "HTMLElement"
},
"childNodes": {
"overrideType": "NodeListOf<ChildNode & Node>"
"overrideType": "NodeListOf<ChildNode>"
},
"firstChild": {
"overrideType": "ChildNode & Node"
"overrideType": "ChildNode"
},
"lastChild": {
"overrideType": "ChildNode & Node"
"overrideType": "ChildNode"
},
"nextSibling": {
"overrideType": "ChildNode & Node"
"overrideType": "ChildNode"
},
"previousSibling": {
"overrideType": "ChildNode & Node"
"overrideType": "ChildNode"
}
}
}
Expand Down