Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Switch to Shadow DOM command #1320

Closed
wants to merge 1 commit into from
Closed
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
81 changes: 81 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ <h3>Dependencies</h3>
<!-- NodeList --> <li><dfn><a href=https://dom.spec.whatwg.org/#nodelist><code>NodeList</code></a></dfn>
<!-- querySelectorAll --> <li><dfn><a href="https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall"><code>querySelectorAll</code></a></dfn>
<!-- querySelector --> <li><dfn><a href="https://dom.spec.whatwg.org/#dom-parentnode-queryselector"><code>querySelector</code></a></dfn>
<!-- shadowRoot --> <li><dfn><a href="https://dom.spec.whatwg.org/#dom-element-shadowroot"><code>shadowRoot</code></a></dfn>
<!-- tagName --> <li><dfn><a href=https://dom.spec.whatwg.org/#dom-element-tagname>tagName</a></dfn>
<!-- Text node --> <li><dfn><a href=https://dom.spec.whatwg.org/#text><code>Text</code> node</a></dfn>
</ul>
Expand Down Expand Up @@ -1325,6 +1326,12 @@ <h3>List of Endpoints</h3>
<td><a>Switch To Parent Frame</a></td>
</tr>

<tr>
<td>POST
<td>/session/{<var>session id</var>}/shadow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be on the element

<td><a>Switch to Shadow DOM</a>
</tr>

<tr>
<td>GET</td>
<td>/session/{<var>session id</var>}/window/rect</td>
Expand Down Expand Up @@ -1724,6 +1731,13 @@ <h3>Handling Errors</h3>
using the given search parameters.
</tr>

<tr>
<td><dfn>no such shadow dom</dfn>
<td>404
<td><code>no such shadow dom</code>
<td>The element does not have a Shadow DOM attached to it.
</tr>

<tr>
<td><dfn>no such frame</dfn>
<td>404
Expand Down Expand Up @@ -3761,6 +3775,73 @@ <h3><dfn>Get Window Handles</dfn></h3>
</aside>
</section> <!-- /Get Window Handles -->

<section>
<h3><dfn>Switch to Shadow DOM</dfn></h3>

<table class="simple jsoncommand">
<tr>
<th>HTTP Method</th>
<th>URI Template</th>
</tr>
<tr>
<td>POST</td>
<td>/session/{<var>session id</var>}/shadow</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be on a web element namespace.

</tr>
</table>

<p>The <a>remote end steps</a> are:

<ol>

<li><p>Let <var>id</var> be the result of
<a>getting the property</a> "<code>id</code>"
from the <var>parameters</var> argument.

<li><p>If <var>id</var> is not <a>null</a>,
or an <a>Object</a> that <a>represents a web element</a>,
return <a>error</a> with <a>error code</a> <a>no such shadow dom</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>null</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id will always be defined if it’s a web element.

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

<dt><var>id</var> <a>represents a web element</a>
<dd>
<ol>
<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>.

<li><p>If <var>element</var> <a>is stale</a>,
return <a>error</a> with <a>error code</a> <a>stale element reference</a>.

<li><p>Let <var>shadowRoot</var> be the result of getting
<var>element</var>'s <a><code>shadowRoot</code></a>.

<li><p>If <var>shadowRoot</var> is <a>null</a>
return <a>error</a> with <a>error code</a> <a>no such shadow dom</a>.

<li><p>Set the <a>current browsing context</a> to <var>element</var>’s
<a><code>shadowRoot</code></a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the shadowRoot type? What if it is closed/open?

</ol>
</dl>

<li><p>Return <a>success</a> with data <a>null</a>.
</ol>
</section> <!-- /Switch to Shadow DOM -->

<section>
<h3><dfn>Switch To Frame</dfn></h3>

Expand Down