Skip to content

Commit efb27e8

Browse files
Default ownership to none in browsingContext.locateNodes (#688)
Default `ownership` to `none` in browsingContext.locateNodes
1 parent 92650cd commit efb27e8

File tree

1 file changed

+40
-38
lines changed

1 file changed

+40
-38
lines changed

index.bs

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,8 +3258,6 @@ list of all nodes matching the specified locator.
32583258
context: browsingContext.BrowsingContext,
32593259
locator: browsingContext.Locator,
32603260
? maxNodeCount: (js-uint .ge 1),
3261-
? ownership: script.ResultOwnership,
3262-
? sandbox: text,
32633261
? serializationOptions: script.SerializationOptions,
32643262
? startNodes: [ + script.SharedReference ]
32653263
}
@@ -3276,7 +3274,7 @@ list of all nodes matching the specified locator.
32763274
</dl>
32773275

32783276
<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|,
32803278
|selector|, |maximum returned node count|, and <var ignore>session</var>:
32813279

32823280
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
32883286
1. For each |context node| of |context nodes|:
32893287

32903288
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
32923290
[=scoping root=] |context node|.
32933291

32943292
1. For each |element| in |elements|:
@@ -3305,8 +3303,8 @@ To <dfn>locate nodes using CSS</dfn> with given |context target|, |context nodes
33053303

33063304
<div algorithm="locate nodes using XPath">
33073305

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>:
33103308

33113309
Note: Owing to the unmaintained state of the XPath specification, this algorithm
33123310
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.
33173315

33183316
1. For each |context node| of |context nodes|:
33193317

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
33213319
[=active document=], with arguments |selector|, |context node|, null,
33223320
[=ORDERED_NODE_SNAPSHOT_TYPE=], and null. If this throws a "[=SyntaxError=]"
33233321
[=DOMException=], return [=error=] with [=error code=] [=invalid selector=];
@@ -3418,17 +3416,8 @@ The [=remote end steps=] with |session| and |command parameters| are:
34183416

34193417
1. Assert: |context| is not null.
34203418

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.
34323421

34333422
1. Let |locator| be |command parameters|["<code>locator</code>"].
34343423

@@ -3465,15 +3454,15 @@ The [=remote end steps=] with |session| and |command parameters| are:
34653454
1. Let |selector| be |locator|["<code>value</code>"].
34663455

34673456
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
34693458
nodes| and |session|.
34703459

34713460
<dt>|type| is the string "<code>xpath</code>"
34723461
<dd>
34733462
1. Let |selector| be |locator|["<code>value</code>"].
34743463

34753464
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
34773466
nodes| and |session|.
34783467

34793468
<dt>|type| is the string "<code>innerText</code>"
@@ -3502,9 +3491,7 @@ The [=remote end steps=] with |session| and |command parameters| are:
35023491
<code>script.SerializationOptions</code> production with the fields
35033492
set to their default values.
35043493

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".
35083495

35093496
1. Let |serialized nodes| be an empty [=/list=].
35103497

@@ -8626,28 +8613,43 @@ This is useful in cases where a context identifier can stand in for the realm
86268613
associated with the context's active document.
86278614

86288615
<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|:
86308617

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|.
86328620

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=].
86358624

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|.
86388628

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:
86408645

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.
86448647

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>"].
86478650

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|.
86518653

86528654
1. Otherwise:
86538655

0 commit comments

Comments
 (0)