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 14 commits into
base: main
Choose a base branch
from
78 changes: 23 additions & 55 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>
Copy link
Contributor

Choose a reason for hiding this comment

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

I conceded excluding aria-roledescription on generic a while back, though I don't fully agree... Adding none to the list of exclusions is probably okay, too.

However, excluding it on all host language native roles is not okay.

Suggested change
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>
Where an element is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a>

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 @@ -804,18 +805,35 @@ <h4 id="el-audio">`audio`</h4>
</tr>
</tbody>
</table>
<h4 id="el-autonomous-custom-element">autonomous custom element</h4>
<h4 id="el-autonomous-custom-element">
autonomous custom elements
and
<span id="el-form-associated-custom-element">form-associated custom elements</span>
</h4>
<table aria-labelledby="el-autonomous-custom-element">
<tbody>
<tr>
<th>HTML Specification</th>
<td>
<a data-cite="HTML">autonomous custom element</a>
and
<a data-cite="html/custom-elements.html#custom-elements-face-example">form-associated custom element</a>
</td>
</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>
<ul>
<li>If the author assigned a conforming ARIA role using the `role` attribute, or by the custom element's internals: map to the specified role.</li>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
<li>else if the author assigned HTML attributes that result in a <a>minimum role</a>: map to the minimum role.</li>
<li>else if the custom element is focusable: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why group? Could we map to unknown or something and log a warning?

Copy link
Contributor

Choose a reason for hiding this comment

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

also this links to generic, not group

Copy link
Contributor

Choose a reason for hiding this comment

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

that typo maight be easier to avoid using the respective <rref> tag...

<li>else if an author specifies a global ARIA attribute on the custom element that creates a relation with another element: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li>
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
<li>else if the custom element has no attached shadow root: map to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the generic minimum role close this off for updates later? Maybe an author intended to add an aria-label at some point later, but this mapping now invalidates that later update?

<li>else if the custom element has an `aria-live` attribute: map to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why generic? Could we map to unknown or something and log a warning? Generic-izing this element will have the side effect of making some other features not work unexpectedly.

Copy link
Member Author

@scottaohara scottaohara Dec 17, 2024

Choose a reason for hiding this comment

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

i'm not sure i follow this or the next comment - since custom elements are presently generic anything that says to map this to generic is essentially keeping the status quo.

<li>else if element internals are used to set a global ARIA property: map to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role.</li>
<li>Otherwise, the custom element maps to the <a class="core-mapping" href="#role-map-none">`none`</a> role.</li>
</ul>
</td>
</tr>
<tr>
<th><a data-cite="core-aam-1.2/#roleMappingComputedRole">Computed Role</a></th>
Expand Down Expand Up @@ -2524,56 +2542,6 @@ <h4 id="el-form">`form`</h4>
</tr>
</tbody>
</table>
<h4 id="el-form-associated-custom-element">form-associated custom element</h4>
<table aria-labelledby="el-form-associated-custom-element">
<tbody>
<tr>
<th>HTML Specification</th>
<td>
<a data-cite="html/custom-elements.html#custom-elements-face-example">form-associated custom element</a>
</td>
</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>
</tr>
<tr>
<th><a data-cite="core-aam-1.2/#roleMappingComputedRole">Computed Role</a></th>
<td class="role-computed"><div class="general">Use WAI-ARIA mapping</div></td>
</tr>
<tr>
<th>
<a href="https://msdn.microsoft.com/en-us/library/dd373608%28v=VS.85%29.aspx">MSAA</a> + <a href="http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/">IAccessible2</a>
</th>
<td>
<div class="general">Use WAI-ARIA mapping</div>
</td>
</tr>
<tr>
<th><a href="https://msdn.microsoft.com/en-us/library/ms726297%28v=VS.85%29.aspx">UIA</a></th>
<td>
<div class="general">Use WAI-ARIA mapping</div>
</td>
</tr>
<tr>
<th><a href="https://gnome.pages.gitlab.gnome.org/atk/">ATK</a></th>
<td>
<div class="general">Use WAI-ARIA mapping</div>
</td>
</tr>
<tr>
<th><a href="https://developer.apple.com/reference/appkit/nsaccessibility">AX</a></th>
<td>
<div class="general">Use WAI-ARIA mapping</div>
</td>
</tr>
<!-- <th><a href="#accessible-name-and-description-computation">Naming Algorithm</a></th> -->
<tr>
<th>Comments</th>
<td></td>
</tr>
</tbody>
</table>
<h4 id="el-h1-h6">`h1`, `h2`, `h3`, `h4`, `h5`, and `h6`</h4>
<table aria-labelledby="el-h1-h6">
<tbody>
Expand Down Expand Up @@ -8680,7 +8648,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 +10139,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