@@ -3258,8 +3258,6 @@ list of all nodes matching the specified locator.
3258
3258
context: browsingContext.BrowsingContext,
3259
3259
locator: browsingContext.Locator,
3260
3260
? maxNodeCount: (js-uint .ge 1),
3261
- ? ownership: script.ResultOwnership,
3262
- ? sandbox: text,
3263
3261
? serializationOptions: script.SerializationOptions,
3264
3262
? startNodes: [ + script.SharedReference ]
3265
3263
}
@@ -3276,7 +3274,7 @@ list of all nodes matching the specified locator.
3276
3274
</dl>
3277
3275
3278
3276
<div algorithm="locate nodes using CSS">
3279
- To <dfn>locate nodes using CSS</dfn> with given |context target |, |context nodes|,
3277
+ To <dfn>locate nodes using CSS</dfn> with given |context|, |context nodes|,
3280
3278
|selector|, |maximum returned node count|, and <var ignore> session</var> :
3281
3279
3282
3280
1. Let |returned nodes| be an empty [=/list=] .
@@ -3288,7 +3286,7 @@ To <dfn>locate nodes using CSS</dfn> with given |context target|, |context nodes
3288
3286
1. For each |context node| of |context nodes|:
3289
3287
3290
3288
1. Let |elements| be the result of [=match a selector against a tree=] with
3291
- |parse result| and |context target |’s [=active document=] [=root=] using
3289
+ |parse result| and |context|’s [=active document=] [=root=] using
3292
3290
[=scoping root=] |context node|.
3293
3291
3294
3292
1. For each |element| in |elements|:
@@ -3305,8 +3303,8 @@ To <dfn>locate nodes using CSS</dfn> with given |context target|, |context nodes
3305
3303
3306
3304
<div algorithm="locate nodes using XPath">
3307
3305
3308
- To <dfn>locate nodes using XPath</dfn> with given |context target |,
3309
- |context nodes|, | selector|, |maximum returned node count|, and <var ignore> session</var> :
3306
+ To <dfn>locate nodes using XPath</dfn> with given |context|, |context nodes |,
3307
+ |selector|, |maximum returned node count|, and <var ignore> session</var> :
3310
3308
3311
3309
Note: Owing to the unmaintained state of the XPath specification, this algorithm
3312
3310
is phrased as if making calls to the XPath DOM APIs. However this is to be understood
@@ -3317,7 +3315,7 @@ without going via the ECMAScript runtime.
3317
3315
3318
3316
1. For each |context node| of |context nodes|:
3319
3317
3320
- 1. Let |evaluate result| be the result of calling [=evaluate=] on |context target |'s
3318
+ 1. Let |evaluate result| be the result of calling [=evaluate=] on |context|'s
3321
3319
[=active document=] , with arguments |selector|, |context node|, null,
3322
3320
[=ORDERED_NODE_SNAPSHOT_TYPE=] , and null. If this throws a "[=SyntaxError=] "
3323
3321
[=DOMException=] , return [=error=] with [=error code=] [=invalid selector=] ;
@@ -3418,17 +3416,8 @@ The [=remote end steps=] with |session| and |command parameters| are:
3418
3416
3419
3417
1. Assert: |context| is not null.
3420
3418
3421
- 1. If |command parameters| [=map/contains=] "<code> sandbox</code> ", let
3422
- |sandbox| be |command parameters|["<code>sandbox</code>"] . Otherwise,
3423
- let |sandbox| be null.
3424
-
3425
- 1. Let |current context target| be the a [=/map=] matching of the
3426
- <code> script.ContextTarget</code> production with the
3427
- <code> context</code> field set to the [=browsing context id=]
3428
- of |context| and the <code> sandbox</code> field set to |sandbox|.
3429
-
3430
- 1. Let |realm| be the result of [=trying=] to [=get a realm from a target=]
3431
- given |current context target|.
3419
+ 1. Let |realm| be the result of [=trying=] to [=get a realm from a browsing context=]
3420
+ with [=browsing context id=] of |context| and null.
3432
3421
3433
3422
1. Let |locator| be |command parameters|["<code>locator</code>"] .
3434
3423
@@ -3465,15 +3454,15 @@ The [=remote end steps=] with |session| and |command parameters| are:
3465
3454
1. Let |selector| be |locator|["<code>value</code>"] .
3466
3455
3467
3456
1. Let |result nodes| be a result of [=trying=] to [=locate nodes using css=]
3468
- given |current context target |, |context nodes|, |selector|, |maximum returned
3457
+ given |context|, |context nodes|, |selector|, |maximum returned
3469
3458
nodes| and |session|.
3470
3459
3471
3460
<dt> |type| is the string "<code> xpath</code> "
3472
3461
<dd>
3473
3462
1. Let |selector| be |locator|["<code>value</code>"] .
3474
3463
3475
3464
1. Let |result nodes| be a result of [=trying=] to [=locate nodes using xpath=]
3476
- given |current context target |, |context nodes|, |selector|, |maximum returned
3465
+ given |context|, |context nodes|, |selector|, |maximum returned
3477
3466
nodes| and |session|.
3478
3467
3479
3468
<dt> |type| is the string "<code> innerText</code> "
@@ -3502,9 +3491,7 @@ The [=remote end steps=] with |session| and |command parameters| are:
3502
3491
<code> script.SerializationOptions</code> production with the fields
3503
3492
set to their default values.
3504
3493
3505
- 1. If |command parameters| [=map/contains=] "<code> ownership</code> ",
3506
- let |result ownership| be |command parameters|["<code>ownership</code>"] .
3507
- Otherwise, let |result ownership| be "none".
3494
+ 1. Let |result ownership| be "none".
3508
3495
3509
3496
1. Let |serialized nodes| be an empty [=/list=] .
3510
3497
@@ -8626,28 +8613,43 @@ This is useful in cases where a context identifier can stand in for the realm
8626
8613
associated with the context's active document.
8627
8614
8628
8615
<div algorithm>
8629
- To <dfn>get a realm from a target </dfn> given |target |:
8616
+ To <dfn>get a realm from a browsing context </dfn> given |context id| and |sandbox |:
8630
8617
8631
- 1. If |target| matches the <code> script.ContextTarget</code> production:
8618
+ 1. Let |context| be the result of [=trying=] to [=get a browsing context=]
8619
+ with |context id|.
8632
8620
8633
- 1. Let |context| be the result of [=trying=] to [=get a browsing context=]
8634
- with |target|["<code>context</code>"] .
8621
+ 1. If |sandbox| is null or is an empty string:
8622
+
8623
+ 1. Let |document| be |context|'s [=active document=] .
8635
8624
8636
- 1. If |target| does not contain a field named "<code> sandbox</code> ", or
8637
- |target|["<code>sandbox</code>"] is an empty string:
8625
+ 1. Let |environment settings| be the [=environment settings object=] whose
8626
+ [=relevant global object=] 's <a>associated <code>Document</code></a> is
8627
+ |document|.
8638
8628
8639
- 1. Let |document| be |context|'s [=active document=] .
8629
+ 1. Let |realm| be |environment settings|' [=realm execution context=]' s
8630
+ Realm component.
8631
+
8632
+ 1. Otherwise: let |realm| be result of [=trying=] to
8633
+ [=get or create a sandbox realm=] given |sandbox| and
8634
+ |context|.
8635
+
8636
+ 1. Return [=success=] with data |realm|
8637
+
8638
+ Issue: This has the wrong error code
8639
+ </div>
8640
+
8641
+ <div algorithm>
8642
+ To <dfn>get a realm from a target</dfn> given |target|:
8643
+
8644
+ 1. If |target| matches the <code> script.ContextTarget</code> production:
8640
8645
8641
- 1. Let |environment settings| be the [=environment settings object=] whose
8642
- [=relevant global object=] 's <a>associated <code>Document</code></a> is
8643
- |document|.
8646
+ 1. Let |sandbox| be null.
8644
8647
8645
- 1. Let |realm| be |environment settings| ' [=realm execution context=]' s
8646
- Realm component .
8648
+ 1. If |target| [=map/contains=] " <code> sandbox </code> ", set |sandbox| to
8649
+ |target| ["<code>sandbox</code>"] .
8647
8650
8648
- 1. Otherwise: let |realm| be result of [=trying=] to
8649
- [=get or create a sandbox realm=] given |target|["<code>sandbox</code>"] and
8650
- |context|.
8651
+ 1. Let |realm| be [=get a realm from a browsing context=] with
8652
+ |target|["<code>context</code>"] and |sandbox|.
8651
8653
8652
8654
1. Otherwise:
8653
8655
0 commit comments