Skip to content

Commit

Permalink
update DOMWalker #1974
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Oct 28, 2024
1 parent 796c3a8 commit a19aa48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accessibility-checker-engine/src/v2/dom/DOMWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class DOMWalker {
considerHidden: boolean;

constructor(element : Node, bEnd? : boolean, root? : Node, considerHidden? : boolean) {
this.root = root || (element.ownerDocument ? element.ownerDocument.documentElement: element);
this.root = root || (element && element.ownerDocument ? element.ownerDocument.documentElement: element);
this.node = element;
this.bEndTag = (bEnd == undefined ? false : bEnd == true);
this.considerHidden = considerHidden || false;
Expand Down

0 comments on commit a19aa48

Please sign in to comment.