@@ -2160,14 +2160,14 @@ <h2>Sessions</h2>
2160
2160
representation of a < a > UUID</ a > ) used to uniquely identify this
2161
2161
session. Unless stated otherwise it is < a > < code > null</ code > </ a > .
2162
2162
2163
- < p > A < a > session</ a > has an associated < dfn > current browsing context </ dfn > ,
2164
- which is the < a > browsing context</ a > against which < a > commands </ a > will run.
2165
-
2166
- < p > A < a > session </ a > has an associated
2167
- < dfn > current top-level browsing context</ dfn > , which is the < a > current browsing
2168
- context </ a > if it itself is a < a > top-level browsing context</ a > , and otherwise
2169
- is the < a > top-level browsing context</ a > of the < a > current browsing
2170
- context</ a > .
2163
+ < p > A < a > session</ a > has an associated < dfn > current browsing
2164
+ context </ dfn > , which is the < a > browsing context</ a > against
2165
+ which < a > commands </ a > will run, an associated < dfn > current parent
2166
+ browsing context </ dfn > , which is set to the parent of the < a > current
2167
+ browsing context</ a > when changing browsing contexts, and an
2168
+ associated < dfn > current top-level browsing context</ dfn > , which is
2169
+ set to the top-browsing context ancestor of the < a > current browsing
2170
+ context</ a > , when changing browsing contexts. </ p >
2171
2171
2172
2172
< p >
2173
2173
A < a > session</ a > has an associated < dfn data-lt ="session script timeout|session page load timeout|session implicit wait timeout "> session timeouts</ dfn >
@@ -2432,10 +2432,9 @@ <h3 id=new-session><dfn data-lt="new sessions|creating a new session">New Sessio
2432
2432
2433
2433
< li > < p > Set the < a > webdriver-active flag</ a > to true.</ p >
2434
2434
2435
- < li > < p > Set the < a > current top-level browsing context</ a >
2436
- for < var > session</ var > in an implementation-specific way. This
2437
- should be the < a > top-level browsing context</ a > of the UA’s
2438
- < a > current browsing context</ a > .
2435
+ < li > < p > < a > Set the current top-level browsing context</ a >
2436
+ for < var > session</ var > with the < a > top-level browsing context</ a >
2437
+ of the UA’s < a > current browsing context</ a > .
2439
2438
2440
2439
< p class ="note "> WebDriver implementations typically start a
2441
2440
completely new browser instance, but there is no requirement in
@@ -2932,8 +2931,8 @@ <h3><dfn>Navigate To</dfn></h3>
2932
2931
< li > < p > < a > Try</ a > to run the < a > post-navigation checks</ a > .
2933
2932
</ ol >
2934
2933
2935
- < li > < p > Set the < a > current browsing context</ a >
2936
- to the < a > current top-level browsing context</ a > .
2934
+ < li > < p > < a > Set the current browsing context</ a > with the < a > current
2935
+ top-level browsing context</ a > .
2937
2936
2938
2937
< li > < p > If the < a > current top-level browsing context</ a > contains
2939
2938
a < a > refresh state pragma directive</ a > of < var > time</ var > 1 second
@@ -3101,8 +3100,8 @@ <h3><dfn>Refresh</dfn></h3>
3101
3100
< li > < p > < a > Try</ a > to run the < a > post-navigation checks</ a > .
3102
3101
</ ol >
3103
3102
3104
- < li > < p > Set the < a > current browsing context</ a >
3105
- to the < a > current top-level browsing context</ a > .
3103
+ < li > < p > < a > Set the current browsing context</ a > with < a > current
3104
+ top-level browsing context</ a > .
3106
3105
3107
3106
< li > < p > Return < a > success</ a > with data < a > < code > null</ code > </ a > .
3108
3107
</ ol >
@@ -3195,6 +3194,28 @@ <h2>Contexts</h2>
3195
3194
</ dl >
3196
3195
</ ol >
3197
3196
3197
+ < p > When required to < dfn > set the current browsing context</ dfn > given
3198
+ a < var > context</ var > , an implementation must follow the following
3199
+ steps:
3200
+ < ol >
3201
+ < li > Set the < a > current session</ a > ’s < a > current browsing
3202
+ context</ a > to < var > context</ var > .
3203
+ < li > Set the < a > current session</ a > ’s < a > current parent browsing
3204
+ context</ a > to the < a > parent browsing context</ a >
3205
+ of < var > context</ var > , if that context exists, or < a > null</ a >
3206
+ otherwise.
3207
+ </ ol >
3208
+
3209
+ < p > When required to < dfn > set the current top-level browsing
3210
+ context</ dfn > given a < var > context</ var > , an implementation must
3211
+ follow the following steps:
3212
+ < ol >
3213
+ < li > Assert: < var > context</ var > is a < a > top-level browsing context</ a > .
3214
+ < li > Set the < a > current session</ a > ’s < a > current top-level browsing
3215
+ context</ a > to < var > context</ var > .
3216
+ < li > < a > Set the current browsing context</ a > to < var > context</ var > .
3217
+ </ ol >
3218
+
3198
3219
< p class =note >
3199
3220
In accordance with
3200
3221
the < a href =https://html.spec.whatwg.org/multipage/interaction.html#focus > focus</ a >
@@ -3292,10 +3313,11 @@ <h3><dfn>Switch To Window</dfn></h3>
3292
3313
focussing of another < a > top-level browsing context</ a > ,
3293
3314
return < a > error</ a > with < a > error code</ a > < a > unexpected alert open</ a > .
3294
3315
3295
- < li > < p > If < var > handle</ var > is equal to the associated < a > window handle</ a >
3296
- for some < a > top-level browsing context</ a > in the < a > current session</ a > ,
3297
- set the < a > session</ a > ’s < a > current browsing context</ a >
3298
- to that browsing context.
3316
+ < li > < p > If < var > handle</ var > is equal to the associated < a > window
3317
+ handle</ a > for some < a > top-level browsing context</ a > in
3318
+ the < a > current session</ a > , let < var > context</ var > be the that
3319
+ browsing context, and
3320
+ < a > set the current top-level browsing context</ a > with < var > context</ var > .
3299
3321
3300
3322
< p > Otherwise, return < a > error</ a > with < a > error code</ a > < a > no such window</ a > .
3301
3323
@@ -3455,7 +3477,7 @@ <h3><dfn>Switch To Frame</dfn></h3>
3455
3477
< dt > < var > id</ var > is < a > < code > null</ code > </ a >
3456
3478
< dd >
3457
3479
< ol >
3458
- < li > < p > Set the < a > current browsing context</ a > to
3480
+ < li > < p > < a > Set the current browsing context</ a > with
3459
3481
the < a > current top-level browsing context</ a > .
3460
3482
</ ol >
3461
3483
@@ -3478,7 +3500,7 @@ <h3><dfn>Switch To Frame</dfn></h3>
3478
3500
< var > window</ var > .< a data-lt ='window.[[\getOwnProperty]] '> < code > [[\GetOwnProperty]]</ code > </ a >
3479
3501
(< var > id</ var > ).
3480
3502
3481
- < li > < p > Set the < a > current browsing context</ a > to
3503
+ < li > < p > < a > Set the current browsing context</ a > with
3482
3504
< var > child window</ var > ’s < a > browsing context</ a > .
3483
3505
</ ol >
3484
3506
@@ -3496,8 +3518,8 @@ <h3><dfn>Switch To Frame</dfn></h3>
3496
3518
or < a > < code > iframe</ code > </ a > element,
3497
3519
return < a > error</ a > with < a > error code</ a > < a > no such frame</ a > .
3498
3520
3499
- < li > < p > Set the < a > current browsing context</ a > to < var > element </ var > ’s
3500
- < a > nested browsing context</ a > .
3521
+ < li > < p > < a > Set the current browsing context</ a >
3522
+ with < var > element </ var > ’s < a > nested browsing context</ a > .
3501
3523
</ ol >
3502
3524
</ dl >
3503
3525
@@ -3539,10 +3561,9 @@ <h3><dfn>Switch To Parent Frame</dfn></h3>
3539
3561
3540
3562
< li > < p > < a > Handle any user prompts</ a > and return its value if it is an < a > error</ a > .
3541
3563
3542
- < li > < p > If the < a > current browsing context</ a > is not equal to
3543
- the < a > current top-level browsing context</ a > ,
3544
- set the < a > current browsing context</ a > to
3545
- the < a > parent browsing context</ a > of the < a > current browsing context</ a > .
3564
+ < li > < p > If the < a > current session</ a > 's < a > current parent browsing
3565
+ context</ a > is not < a > null</ a > , < a > set the current browsing
3566
+ context</ a > with the < a > current parent browsing context</ a > .
3546
3567
3547
3568
< li > < p > Update any implementation-specific state that would result
3548
3569
from the user selecting the < a > current browsing context</ a > for
0 commit comments