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

Update: change default role for custom elements #2383

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 3 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
47 changes: 41 additions & 6 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ <h3>HTML Element Role Mappings</h3>
specified which would require a more specific <a>minimum role</a> to be exposed.
</li>
<li>
Where an element is indicated as having &quot;No corresponding (WAI-ARIA) role&quot;, or is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role, user agents
Where an element is indicated as having &quot;No corresponding (WAI-ARIA) role&quot;, or is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
or <a class="core-mapping" href="#role-map-none">`none`</a> roles, user agents
MUST NOT expose the <a class="core-mapping" href="#ariaRoleDescription">`aria-roledescription`</a> property value in the <a class="termref">accessibility tree</a> unless the element has an
explicit, conforming `role` attribute value which [[WAI-ARIA-1.2]] does not prohibit the use of `aria-roledescription`.
</li>
Expand Down Expand Up @@ -815,7 +816,19 @@ <h4 id="el-autonomous-custom-element">autonomous custom element</h4>
</tr>
<tr>
<th>[[wai-aria-1.2]]</th>
<td>If the author assigned a conforming ARIA role using the `role` attribute, map to that role. Otherwise, the <a class="core-mapping" href="#role-map-generic">`generic`</a> role.</td>
<td>
<p>
If the author assigned a conforming ARIA role using the `role` attribute,
or by the custom element's internals, map to the specified role.
</p>
<p>
If the author assigned attributes that result in a <a>minimum role</a>, then map
to the minimum role (see <a href="#custom-element-comments">comments</a>).
</p>
<p>
Otherwise, the element maps to the <a class="core-mapping" href="#role-map-none">`none`</a> role.
</p>
</td>
</tr>
<tr>
<th><a data-cite="core-aam-1.2/#roleMappingComputedRole">Computed Role</a></th>
Expand Down Expand Up @@ -849,8 +862,30 @@ <h4 id="el-autonomous-custom-element">autonomous custom element</h4>
</tr>
<!-- <th><a href="#accessible-name-and-description-computation">Naming Algorithm</a></th> -->
<tr>
<th>Comments</th>
<td></td>
<th id=custom-element-comments>Comments</th>
<td>
<p>
Along with the attributes defined in this specification that participate in modifying an element's <a>minimum role</a>,
the following conditions will also alter a custom element's computed role, if an author has not otherwise specified an
explicit role for the element:
</p>
<ul>
<li>if the custom element is focusable: expose as <a class="core-mapping" href="#role-map-group">`group`</a> role</li>
<li>if the custom element has an `aria-live` or `aria-owns` attribute: expose as <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li>
<li>if element internals are used to set a global ARIA property: expose as <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li>
<li>if an author specifies an ARIA relation via an element attribute: expose <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li>
</ul>
<div class="example">
<p>The following is an exmaple of an author specifiying an ARIA relation on a custom element, with another element in the DOM.</p>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
<pre>
<code>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
&lt;my-element aria-details=ex>...&lt;my-element>
...
&lt;div id=ex> &lt;!-- details for my-element --> &lt;/div>
</code>
</pre>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
</div>
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -8680,7 +8715,7 @@ <h4 id="att-autofocus">`autofocus`</h4>
</tr>
<tr>
<th>Comments</th>
<td>Provides a <a href="termref">minimum role</a> of <a class="core-mapping" href="#role-map-group">`group`</a>.</td>
<td>Provides a <a>minimum role</a> of <a class="core-mapping" href="#role-map-group">`group`</a>.</td>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -10171,7 +10206,7 @@ <h4 id="att-draggable">`draggable`</h4>
</tr>
<tr>
<th>Comments</th>
<td>Provides a <a href="termref">minimum role</a> of <a class="core-mapping" href="#role-map-group">`group`</a>.</td>
<td>Provides a <a>minimum role</a> of <a class="core-mapping" href="#role-map-group">`group`</a>.</td>
</tr>
</tbody>
</table>
Expand Down
Loading