-
Notifications
You must be signed in to change notification settings - Fork 195
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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 | ||
<td><a>Switch to Shadow DOM</a> | ||
</tr> | ||
|
||
<tr> | ||
<td>GET</td> | ||
<td>/session/{<var>session id</var>}/window/rect</td> | ||
|
@@ -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 | ||
|
@@ -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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
<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>. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the |
||
</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> | ||
|
||
|
There was a problem hiding this comment.
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