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 support for calculating the accessible label and the accessible role of elements #1444

Merged
merged 4 commits into from
May 29, 2020
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
100 changes: 98 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,18 @@ <h3>Endpoints</h3>
<td><a>Is Element Enabled</a></td>
</tr>

<tr>
<td>GET</td>
<td>/session/{<var>session id</var>}/element/{<var>element id</var>}/computedrole</td>
<td><a>Get Computed Role</a></td>
</tr>

<tr>
<td>GET</td>
<td>/session/{<var>session id</var>}/element/{<var>element id</var>}/computedlabel</td>
<td><a>Get Computed Label</a></td>
</tr>

<tr>
<td>POST</td>
<td>/session/{<var>session id</var>}/element/{<var>element id</var>}/click</td>
Expand Down Expand Up @@ -5153,6 +5165,73 @@ <h4><dfn>Is Element Enabled</dfn></h4>
<li><p>Return <a>success</a> with data <var>enabled</var>.
</ol>
</section> <!-- /Is Element Enabled -->

<section>
<h4><dfn>Get Computed Role</dfn></h4>

<table class="simple jsoncommand">
<tr>
<th>HTTP Method</th>
<th>URI Template</th>
</tr>
<tr>
<td>GET</td>
<td>/session/{<var>session id</var>}/element/{<var>element id</var>}/computedrole</td>
</tr>
</table>

<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><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 connected element</a>
with <a>url variable</a> <var>element id</var>.

<li><p>Let <var>role</var> be the result of computing the <a>WAI-ARIA role</a> of <var>element</var>.

<li><p>Return <a>success</a> with data <var>role</var>.
</ol>
</section> <!-- /Get Element Computed Role -->

<section>
<h4><dfn>Get Computed Label</dfn></h4>

<table class="simple jsoncommand">
<tr>
<th>HTTP Method</th>
<th>URI Template</th>
</tr>
<tr>
<td>GET</td>
<td>/session/{<var>session id</var>}/element/{<var>element id</var>}/computedlabel</td>
</tr>
</table>

<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><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 connected element</a>
with <a>url variable</a> <var>element id</var>.

<li><p>Let <var>label</var> be the result of a <a>Accessible Name and Description Computation</a> for the <a>Accessible Name</a> of the <var>element</var>.

<li><p>Return <a>success</a> with data <var>label</var>.
</ol>
</section> <!-- /Get Element Computed Label -->
</section> <!-- /State -->

<section>
Expand Down Expand Up @@ -5834,10 +5913,10 @@ <h4><dfn>Element Send Keys</dfn></h4>
<dt>Otherwise
<dd>
<ol>
<li><p>If <var>element</var> does not currently have focus,
<li><p>If <var>element</var> does not currently have focus,
let <var>current text length</var> be the
<a>string length</a> of <var><a>element</a></var>’s <a>API value</a>.

<li><p>Set the text insertion caret using <a>set selection range</a>
using <var>current text length</var> for both the <code>start</code>
and <code>end</code> parameters.
Expand Down Expand Up @@ -9513,6 +9592,23 @@ <h2>Index</h2>
-->

<dl>
<dt>ARIA and related specifications
<dd>
<p>The following terms are defined
in the Accessible Rich Internet Applications (WAI-ARIA) 1.2 specification: [[wai-aria-1.2]]
<ul>
<li><dfn><a href="https://w3c.github.io/aria/#introroles">WAI-ARIA role</a></dfn>
</ul>

<dd>
<p>The following terms are defined
in the Accessible Name and Description Computation 1.1 specification: [[accname-1.1]]
<ul>
<li><dfn><a href="https://www.w3.org/TR/accname-1.1/#dfn-accessible-name">Accessible Name</a></dfn>
<li><dfn><a href="https://www.w3.org/TR/accname-1.1/#mapping_additional_nd_te">Accessible
Name and Description Computation</a></dfn>
</ul>

<dt>Web App Security
<dd><p>The following terms are defined
in the Content Security Policy Level 3 specification: [[CSP3]]
Expand Down