Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.7.3
Choose a base ref
...
head repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.7.4
Choose a head ref
  • 4 commits
  • 1 file changed
  • 2 contributors

Commits on Feb 22, 2023

  1. Copy the full SHA
    c439cc1 View commit details

Commits on Feb 23, 2023

  1. Copy the full SHA
    fd1ddb4 View commit details

Commits on Feb 24, 2023

  1. Copy the full SHA
    2df12ce View commit details
  2. Merge pull request #777 from CSchulz/patch-6

    #776@patch: Add self equality check in node.contains method.
    capricorn86 authored Feb 24, 2023
    Copy the full SHA
    ca0d075 View commit details
Showing with 3 additions and 0 deletions.
  1. +3 −0 packages/happy-dom/src/nodes/node/Node.ts
3 changes: 3 additions & 0 deletions packages/happy-dom/src/nodes/node/Node.ts
Original file line number Diff line number Diff line change
@@ -233,6 +233,9 @@ export default class Node extends EventTarget implements INode {
* @returns "true" if this node contains the other node.
*/
public contains(otherNode: INode): boolean {
if (this === otherNode) {
return true;
}
for (const childNode of this.childNodes) {
if (childNode === otherNode || childNode.contains(otherNode)) {
return true;