Skip to content

Commit

Permalink
Add support for calculating the accessible label and the accessible r…
Browse files Browse the repository at this point in the history
…ole of elements

Fixes #1439
  • Loading branch information
AutomatedTester committed Sep 25, 2019
1 parent 3216584 commit 7ea9483
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,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 @@ -5140,6 +5152,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>.

This comment has been minimized.

Copy link
@cookiecrook

cookiecrook Nov 6, 2019

I think this should be "accessibility role" b/c it is not limited to WAI-ARIA defined roles... Even once ARIA 1.2 is finished for HTML Parity, there are reserved roles like MathML elements, and native ones that can't be "faked" with ARIA yet, such as the


<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>ARIA computation</a> for the <a>Accessible Name</a> of the <var>element</var>.

This comment has been minimized.

Copy link
@cookiecrook

cookiecrook Nov 6, 2019

Should be "Accessible Name Computation" b/c it's not specific to ARIA.


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

<section>
Expand Down Expand Up @@ -9205,6 +9284,24 @@ <h2>Index</h2>
-->

<dl>
<dt>ARIA
<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>

<dt>Accessible Name and Description Computation
<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 data-lt="ARIA computation" href="https://www.w3.org/TR/accname-1.1/#mapping_additional_nd_te">Accessible

This comment has been minimized.

Copy link
@cookiecrook

cookiecrook Nov 6, 2019

Ditto Accessible Name Comp, not ARIA Comp.

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

1 comment on commit 7ea9483

@cookiecrook
Copy link

@cookiecrook cookiecrook commented on 7ea9483 Nov 6, 2019

Choose a reason for hiding this comment

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

Note: Most implementations would spin up accessibility the first time either of these is called. Note that there is a non-zero perf cost to running the Accessibility underpinnings in any implementation... So: 1. Implementations should be careful to avoid loading this before it is needed, and 2. Benchmark test developers should be made aware of the perf cost of these... For example, a performance reduction may be persistent in later in the test anytime after one of these has been called.

Please sign in to comment.