Skip to content

Commit

Permalink
Do not count document or document fragment in maxdepth
Browse files Browse the repository at this point in the history
  • Loading branch information
sadym-chromium committed May 21, 2024
1 parent 96dcbbf commit 0a4a419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bidiMapper/modules/context/BrowsingContextImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ export class BrowsingContextImpl {
const children = [...node.children];
children.forEach((child) =>
returnedNodes.push(
...locateNodesUsingInnerText(child, currentMaxDepth - 1)
...locateNodesUsingInnerText(child, currentMaxDepth)
)
);
return returnedNodes;
Expand Down Expand Up @@ -1209,7 +1209,7 @@ export class BrowsingContextImpl {
} else {
const childNodeMatches =
// Don't search deeper if `maxDepth` is reached.
currentMaxDepth === 0
currentMaxDepth <= 0
? []
: childNodes
.map((child) =>
Expand Down

0 comments on commit 0a4a419

Please sign in to comment.