Skip to content

Commit 4e162b9

Browse files
Update browsingContext.locateNodes (#713)
Do not decrease max depth when traversing document or document fragment
1 parent df62040 commit 4e162b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.bs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,16 +3390,18 @@ To <dfn>locate nodes using inner text</dfn> with given |context nodes|,
33903390

33913391
1. If |context node| implements {{Document}} or {{DocumentFragment}}:
33923392

3393+
Note: when traversing the document or document fragment, <code>max depth</code>
3394+
is not decreased intentionally to make the search result with
3395+
<code>document</code> and <code>document.documentElement</code> equivalent.
3396+
33933397
1. Let |child nodes| be an empty [=/list=].
33943398

33953399
1. For each node |child| in the <a spec=dom>children</a> of |context node|.
33963400

33973401
1. [=list/Append=] |child| to |child nodes|.
33983402

3399-
1. Let |child max depth| be null if |max depth| is null, or |max depth| - 1 otherwise.
3400-
34013403
1. [=Extend=] |returned nodes| with the result of [=trying=] to [=locate nodes using inner text=]
3402-
with |child nodes|, |selector|, |child max depth|, |match type|, |ignore case|, and |maximum returned node count|.
3404+
with |child nodes|, |selector|, |max depth|, |match type|, |ignore case|, and |maximum returned node count|.
34033405

34043406
1. If |context node| does not implement {{HTMLElement}} then [=continue=].
34053407

0 commit comments

Comments
 (0)