Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 74 additions & 37 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2160,14 +2160,14 @@ <h2>Sessions</h2>
representation of a <a>UUID</a>) used to uniquely identify this
session. Unless stated otherwise it is <a><code>null</code></a>.

<p>A <a>session</a> has an associated <dfn>current browsing context</dfn>,
which is the <a>browsing context</a> against which <a>commands</a> will run.

<p>A <a>session</a> has an associated
<dfn>current top-level browsing context</dfn>, which is the <a>current browsing
context</a> if it itself is a <a>top-level browsing context</a>, and otherwise
is the <a>top-level browsing context</a> of the <a>current browsing
context</a>.
<p>A <a>session</a> has an associated <dfn>current browsing
context</dfn>, which is the <a>browsing context</a> against
which <a>commands</a> will run, an associated <dfn>current parent
browsing context</dfn>, which is set to the parent of the <a>current
browsing context</a> when changing browsing contexts, and an
associated <dfn>current top-level browsing context</dfn>, which is
set to the top-browsing context ancestor of the <a>current browsing
context</a>, when changing browsing contexts.</p>

<p>
A <a>session</a> has an associated <dfn data-lt="session script timeout|session page load timeout|session implicit wait timeout">session timeouts</dfn>
Expand Down Expand Up @@ -2432,10 +2432,9 @@ <h3 id=new-session><dfn data-lt="new sessions|creating a new session">New Sessio

<li><p>Set the <a>webdriver-active flag</a> to true.</p>

<li><p>Set the <a>current top-level browsing context</a>
for <var>session</var> in an implementation-specific way. This
should be the <a>top-level browsing context</a> of the UA’s
<a>current browsing context</a>.
<li><p><a>Set the current top-level browsing context</a>
for <var>session</var> with the <a>top-level browsing context</a>
of the UA’s <a>current browsing context</a>.

<p class="note">WebDriver implementations typically start a
completely new browser instance, but there is no requirement in
Expand Down Expand Up @@ -2932,8 +2931,8 @@ <h3><dfn>Navigate To</dfn></h3>
<li><p><a>Try</a> to run the <a>post-navigation checks</a>.
</ol>

<li><p>Set the <a>current browsing context</a>
to the <a>current top-level browsing context</a>.
<li><p><a>Set the current browsing context</a> with the <a>current
top-level browsing context</a>.

<li><p>If the <a>current top-level browsing context</a> contains
a <a>refresh state pragma directive</a> of <var>time</var> 1 second
Expand Down Expand Up @@ -3101,8 +3100,8 @@ <h3><dfn>Refresh</dfn></h3>
<li><p><a>Try</a> to run the <a>post-navigation checks</a>.
</ol>

<li><p>Set the <a>current browsing context</a>
to the <a>current top-level browsing context</a>.
<li><p><a>Set the current browsing context</a> with <a>current
top-level browsing context</a>.

<li><p>Return <a>success</a> with data <a><code>null</code></a>.
</ol>
Expand Down Expand Up @@ -3195,6 +3194,28 @@ <h2>Contexts</h2>
</dl>
</ol>

<p>When required to <dfn>set the current browsing context</dfn> given
a <var>context</var>, an implementation must follow the following
steps:
<ol>
<li>Set the <a>current session</a>’s <a>current browsing
context</a> to <var>context</var>.
<li>Set the <a>current session</a>’s <a>current parent browsing
context</a> to the <a>parent browsing context</a>
of <var>context</var>, if that context exists, or <a>null</a>
otherwise.
</ol>

<p>When required to <dfn>set the current top-level browsing
context</dfn> given a <var>context</var>, an implementation must
follow the following steps:
<ol>
<li>Assert: <var>context</var> is a <a>top-level browsing context</a>.
<li>Set the <a>current session</a>’s <a>current top-level browsing
context</a> to <var>context</var>.
<li><a>Set the current browsing context</a> to <var>context</var>.
</ol>

<p class=note>
In accordance with
the <a href=https://html.spec.whatwg.org/multipage/interaction.html#focus>focus</a>
Expand Down Expand Up @@ -3292,10 +3313,11 @@ <h3><dfn>Switch To Window</dfn></h3>
focussing of another <a>top-level browsing context</a>,
return <a>error</a> with <a>error code</a> <a>unexpected alert open</a>.

<li><p>If <var>handle</var> is equal to the associated <a>window handle</a>
for some <a>top-level browsing context</a> in the <a>current session</a>,
set the <a>session</a>’s <a>current browsing context</a>
to that browsing context.
<li><p>If <var>handle</var> is equal to the associated <a>window
handle</a> for some <a>top-level browsing context</a> in
the <a>current session</a>, let <var>context</var> be the that
browsing context, and
<a>set the current top-level browsing context</a> with <var>context</var>.

<p>Otherwise, return <a>error</a> with <a>error code</a> <a>no such window</a>.

Expand Down Expand Up @@ -3443,20 +3465,21 @@ <h3><dfn>Switch To Frame</dfn></h3>
or an <a>Object</a> that <a>represents a web element</a>,
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>If the <a>current browsing context</a> is <a>no longer open</a>,
return <a>error</a> with <a>error code</a> <a>no such window</a>.

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

<li><p>Run the substeps of the first matching condition:

<dl class=switch>
<dt><var>id</var> is <a><code>null</code></a>
<dd>
<ol>
<li><p>Set the <a>current browsing context</a> to
the <a>current top-level browsing context</a>.
<li><p>If the <a>current top-level browsing context</a> is <a>no
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
such window</a>.

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

<li><p><a>Set the current browsing context</a> with
the <a>current top-level browsing context</a>.
</ol>

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

<li><p>If the <a>current browsing context</a> is <a>no
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
such window</a>.

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

<li><p>Let <var>window</var> be the <a>associated window</a>
of the <a>current browsing context</a>’s <a>active document</a>.

Expand All @@ -3478,13 +3508,20 @@ <h3><dfn>Switch To Frame</dfn></h3>
<var>window</var>.<a data-lt='window.[[\getOwnProperty]]'><code>[[\GetOwnProperty]]</code></a>
(<var>id</var>).

<li><p>Set the <a>current browsing context</a> to
<li><p><a>Set the current browsing context</a> with
<var>child window</var>’s <a>browsing context</a>.
</ol>

<dt><var>id</var> <a>represents a web element</a>
<dd>
<ol>
<li><p>If the <a>current browsing context</a> is <a>no
longer open</a>, return <a>error</a> with <a>error code</a> <a>no
such window</a>.

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

<li><p>Let <var>element</var> be the result
of <a>trying</a> to <a>get a known element</a>
by <a>web element reference</a> <var>id</var>.
Expand All @@ -3496,8 +3533,8 @@ <h3><dfn>Switch To Frame</dfn></h3>
or <a><code>iframe</code></a> element,
return <a>error</a> with <a>error code</a> <a>no such frame</a>.

<li><p>Set the <a>current browsing context</a> to <var>element</var>’s
<a>nested browsing context</a>.
<li><p><a>Set the current browsing context</a>
with <var>element</var>’s <a>nested browsing context</a>.
</ol>
</dl>

Expand Down Expand Up @@ -3534,15 +3571,15 @@ <h3><dfn>Switch To Parent Frame</dfn></h3>
<p>The <a>remote end steps</a> are:

<ol>
<li><p>If the <a>current browsing context</a> is <a>no longer open</a>,
return <a>error</a> with <a>error code</a> <a>no such window</a>.
<li><p>If the <a>current parent browsing context</a> is <a>no longer
open</a>, return <a>error</a> with <a>error code</a> <a>no such
window</a>.

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

<li><p>If the <a>current browsing context</a> is not equal to
the <a>current top-level browsing context</a>,
set the <a>current browsing context</a> to
the <a>parent browsing context</a> of the <a>current browsing context</a>.
<li><p>If the <a>current session</a>'s <a>current parent browsing
context</a> is not <a>null</a>, <a>set the current browsing
context</a> with the <a>current parent browsing context</a>.

<li><p>Update any implementation-specific state that would result
from the user selecting the <a>current browsing context</a> for
Expand Down