@@ -3384,6 +3384,21 @@ To <dfn>locate nodes using inner text</dfn> with given |context nodes|,
3384
3384
3385
3385
1. For each |context node| in |context nodes|:
3386
3386
3387
+ 1. If |context node| implements {{Document}} or {{DocumentFragment}} :
3388
+
3389
+ 1. Let |child nodes| be an empty [=/list=] .
3390
+
3391
+ 1. For each node |child| in the <a spec=dom>children</a> of |context node|.
3392
+
3393
+ 1. [=list/Append=] |child| to |child nodes|.
3394
+
3395
+ 1. Let |child max depth| be null if |max depth| is null, or |max depth| - 1 otherwise.
3396
+
3397
+ 1. [=Extend=] |returned nodes| with the result of [=trying=] to [=locate nodes using inner text=]
3398
+ with |child nodes|, |selector|, |child max depth|, |match type|, |ignore case|, and |maximum returned node count|.
3399
+
3400
+ 1. If |context node| does not implement {{HTMLElement}} then [=continue=] .
3401
+
3387
3402
1. Let |node inner text| be the result of calling the [=innerText getter steps=] with
3388
3403
|context node| as the [=this=] value.
3389
3404
@@ -3397,7 +3412,7 @@ To <dfn>locate nodes using inner text</dfn> with given |context nodes|,
3397
3412
1. Let |child nodes| be an empty [=/list=] and, for each node |child| in the
3398
3413
<a spec=dom>children</a> of |context node|:
3399
3414
3400
- 1. If |child| implements {{Element}} , [=list/append =] |child| to |child nodes|.
3415
+ 1. [=list/Append =] |child| to |child nodes|.
3401
3416
3402
3417
1. If [=list/size=] of |child nodes| is equal to 0 or |max depth| is equal to 0,
3403
3418
perform the following steps:
@@ -3410,12 +3425,10 @@ To <dfn>locate nodes using inner text</dfn> with given |context nodes|,
3410
3425
3411
3426
1. Otherwise, perform the following steps:
3412
3427
3413
- 1. If |max depth| is not null:
3414
-
3415
- 1. Set |max depth| to |max depth| - 1.
3428
+ 1. Let |child max depth| be null if |max depth| is null, or |max depth| - 1 otherwise.
3416
3429
3417
3430
1. Let |child node matches| be the result of [=locate nodes using inner text=]
3418
- with |child nodes|, |selector|, |max depth|, |match type|,
3431
+ with |child nodes|, |selector|, |child max depth| , |match type|,
3419
3432
|ignore case|, and |maximum returned node count|.
3420
3433
3421
3434
1. If [=list/size=] of |child node matches| is equal to 0 and |match type| is
0 commit comments