Skip to content

Commit afc3d5d

Browse files
jgrahamAutomatedTester
authored andcommitted
Update the browsing context checks for switch to [parent] frame
This ensures that we only fail these operations if the browsing context we're trying to switch to is missing, not the current browsing context.
1 parent 7f61e66 commit afc3d5d

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

index.html

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,20 +3465,21 @@ <h3><dfn>Switch To Frame</dfn></h3>
34653465
or an <a>Object</a> that <a>represents a web element</a>,
34663466
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
34673467

3468-
<li><p>If the <a>current browsing context</a> is <a>no longer open</a>,
3469-
return <a>error</a> with <a>error code</a> <a>no such window</a>.
3470-
3471-
<li><p><a>Handle any user prompts</a>
3472-
and return its value if it is an <a>error</a>.
3473-
34743468
<li><p>Run the substeps of the first matching condition:
34753469

34763470
<dl class=switch>
34773471
<dt><var>id</var> is <a><code>null</code></a>
34783472
<dd>
34793473
<ol>
3474+
<li><p>If the <a>current top-level browsing context</a> is <a>no
3475+
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
3476+
such window</a>.
3477+
3478+
<li><p><a>Handle any user prompts</a>
3479+
and return its value if it is an <a>error</a>.
3480+
34803481
<li><p><a>Set the current browsing context</a> with
3481-
the <a>current top-level browsing context</a>.
3482+
the <a>current top-level browsing context</a>.
34823483
</ol>
34833484

34843485
<dt><var>id</var> is a <code>Number</code> object
@@ -3487,6 +3488,13 @@ <h3><dfn>Switch To Frame</dfn></h3>
34873488
<li><p>If <var>id</var> is less than 0 or greater than 2<sup>16</sup> – 1,
34883489
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
34893490

3491+
<li><p>If the <a>current browsing context</a> is <a>no
3492+
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
3493+
such window</a>.
3494+
3495+
<li><p><a>Handle any user prompts</a>
3496+
and return its value if it is an <a>error</a>.
3497+
34903498
<li><p>Let <var>window</var> be the <a>associated window</a>
34913499
of the <a>current browsing context</a>’s <a>active document</a>.
34923500

@@ -3507,6 +3515,13 @@ <h3><dfn>Switch To Frame</dfn></h3>
35073515
<dt><var>id</var> <a>represents a web element</a>
35083516
<dd>
35093517
<ol>
3518+
<li><p>If the <a>current browsing context</a> is <a>no
3519+
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
3520+
such window</a>.
3521+
3522+
<li><p><a>Handle any user prompts</a>
3523+
and return its value if it is an <a>error</a>.
3524+
35103525
<li><p>Let <var>element</var> be the result
35113526
of <a>trying</a> to <a>get a known element</a>
35123527
by <a>web element reference</a> <var>id</var>.
@@ -3556,8 +3571,9 @@ <h3><dfn>Switch To Parent Frame</dfn></h3>
35563571
<p>The <a>remote end steps</a> are:
35573572

35583573
<ol>
3559-
<li><p>If the <a>current browsing context</a> is <a>no longer open</a>,
3560-
return <a>error</a> with <a>error code</a> <a>no such window</a>.
3574+
<li><p>If the <a>current parent browsing context</a> is <a>no longer
3575+
open</a>, return <a>error</a> with <a>error code</a> <a>no such
3576+
window</a>.
35613577

35623578
<li><p><a>Handle any user prompts</a> and return its value if it is an <a>error</a>.
35633579

0 commit comments

Comments
 (0)