Skip to content

Commit

Permalink
Merge pull request #437 from capricorn86/task/433-element_node-is-mis…
Browse files Browse the repository at this point in the history
…sing-from-the-node-instance

#433@minor: Adds support for Node.ELEMENT_NODE, Node.TEXT_NODE etc. o…
  • Loading branch information
capricorn86 committed Mar 30, 2022
2 parents 548c33a + ce29165 commit 7f23542
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/happy-dom/src/nodes/node/INode.ts
Expand Up @@ -4,6 +4,12 @@ import IElement from '../element/IElement';
import INodeList from './INodeList';

export default interface INode extends IEventTarget {
readonly ELEMENT_NODE: number;
readonly TEXT_NODE: number;
readonly COMMENT_NODE: number;
readonly DOCUMENT_NODE: number;
readonly DOCUMENT_TYPE_NODE: number;
readonly DOCUMENT_FRAGMENT_NODE: number;
readonly ownerDocument: IDocument;
readonly parentNode: INode;
readonly parentElement: IElement;
Expand Down
6 changes: 6 additions & 0 deletions packages/happy-dom/src/nodes/node/Node.ts
Expand Up @@ -22,6 +22,12 @@ export default class Node extends EventTarget implements INode {
public static readonly DOCUMENT_TYPE_NODE = 10;
public static readonly DOCUMENT_FRAGMENT_NODE = 11;
public static ownerDocument: IDocument = null;
public readonly ELEMENT_NODE = 1;
public readonly TEXT_NODE = 3;
public readonly COMMENT_NODE = 8;
public readonly DOCUMENT_NODE = 9;
public readonly DOCUMENT_TYPE_NODE = 10;
public readonly DOCUMENT_FRAGMENT_NODE = 11;
public readonly ownerDocument: IDocument = null;
public readonly parentNode: INode = null;
public readonly nodeType: number;
Expand Down

0 comments on commit 7f23542

Please sign in to comment.