Repository navigation
Update: add mapping tables for customizable select #2369
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
base: main
Are you sure you want to change the base?
Changes from all commits
a0ab974
cf8ff97
8ba47a3
beda61a
9c36290
843ba8a
e8d5485
709675e
56a6bcc
084e51f
a1a5aa1
e7aa61c
8e6a883
181c9cf
8ba475e
dce5a17
203e008
df2b946
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 |
|---|---|---|
|
|
@@ -1293,6 +1293,83 @@ <h4 id="el-button">`button`</h4> | |
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| <h4 id="el-button-select-child">`button` as a child of a `select` element</h4> | ||
| <table aria-labelledby="el-button-select-child"> | ||
| <tbody> | ||
| <tr> | ||
| <th>HTML Specification</th> | ||
| <td> | ||
| <a data-cite="HTML">`button`</a> | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <th>[[wai-aria-1.2]]</th> | ||
| <td> | ||
| <div class="general">Not mapped. <a href="#el-button-select-child-comments">See comments</a>.</div> | ||
| <!-- a button that is a child of a select is not a typical "button" element. | ||
| it does not serve as a submit, reset, or generic 'button' type. Rather, | ||
| its purpose is directly tied to the rendering of a customized select | ||
| serving as the visible indicator/styleable node to serve as the | ||
| invoking element for the select's listbox popup. | ||
| --> | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <th><a data-cite="core-aam-1.2/#roleMappingComputedRole">Computed Role</a></th> | ||
| <td class="role-computed"> | ||
| <div class="general">Not mapped. <a href="#el-button-select-child-comments">See comments</a>.</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"><a href="#el-button-select-child-comments">See comments</a></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"><a href="#el-button-select-child-comments">See comments</a></div> | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <th><a href="https://gnome.pages.gitlab.gnome.org/atk/">ATK</a></th> | ||
| <td> | ||
| <div class="general"><a href="#el-button-select-child-comments">See comments</a></div> | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <th><a href="https://developer.apple.com/reference/appkit/nsaccessibility">AX</a></th> | ||
| <td> | ||
| <div class="general"><a href="#el-button-select-child-comments">See comments</a></div> | ||
| </td> | ||
| </tr> | ||
| <!-- <th><a href="#accessible-name-and-description-computation">Naming Algorithm</a></th> --> | ||
| <tr> | ||
| <th id="el-button-select-child-comments">Comments</th> | ||
| <td> | ||
| <p> | ||
| User agents treat the child `button` element of a `select` element as inert. | ||
| The `select` and its child `button` part are meant to be considered a single item to users and in the user agent's accessibility tree. | ||
| </p> | ||
| <p> | ||
| The <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the subtree of the | ||
| `button` element participates in the accessible value calculation of the `select` element. | ||
| See the <a href="#el-select-combobox">`select`<span class="el-context"> (with NO `multiple` attribute and NO `size` attribute having value greater than `1`)</span></a> for more information. | ||
| </p> | ||
| <p> | ||
| User agents MAY warn developers that the use of global HTML or ARIA attributes, or attributes specific to the `button` element or ARIA's `button` role are not expected to be used on a `button` element in this context. | ||
| </p> | ||
| <p class=note> | ||
| As this `button` element is inert, any use of global HTML or ARIA attributes, or attributes specific to the `button` element or ARIA's `button` role are not exposed to the user agent's accessibility API. | ||
| </p> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| <h4 id="el-canvas">`canvas`</h4> | ||
| <table class="data" aria-labelledby="el-canvas"> | ||
| <tbody> | ||
|
|
@@ -6420,7 +6497,46 @@ <h4 id="el-select-combobox">`select`<span class="el-context"> (with NO `multiple | |
| <!-- <th><a href="#accessible-name-and-description-computation">Naming Algorithm</a></th> --> | ||
| <tr> | ||
| <th>Comments</th> | ||
| <td></td> | ||
| <td> | ||
| <p>To calculate the accessible value of a `select` element:</p> | ||
| <ol> | ||
| <li>If `aria-valuetext` is specified on the `select` element, use the attribute's value, including the empty string.</li> | ||
| <li>Else if there is a `button` part, calculate the accessible value from a non-empty string <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the subtree of that element.</li> | ||
|
Contributor
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. Is there anything in the HTML spec that prevents the author from putting something other than the value in the |
||
| <li>If the `select` element does not have an `aria-valuetext` attribute and has not calculated a usable value from its button part, then the accessible value is calculated from the accessible name of the selected `option` element, even if the accessible name of the selected `option` is the empty string.</li> | ||
| </ol> | ||
| <!-- provide a link to the ARIA spec when the https://github.com/w3c/aria/pull/2417 PR lands --> | ||
|
|
||
| <p> | ||
| The calculated role of the customizable `select` element's popup picker is a `listbox`, by default.</p> | ||
| <p> | ||
| If authors include invalid elements (according to the the `select` element's content model) as descendants of the `select` element, and those invalid elements result in accessible objects being present as siblings in the accessibility tree to the valid descendent elements of the select, then user agents SHOULD expose the popup picker with the role of `dialog` in the modeless state.</p> | ||
|
Contributor
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. Implementation requirements that depend on content model are unusual. Browsers typically don't include conformance checkers, so can't easily tell if the content model is being violated or not. What is the purpose here?
Member
Author
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. thanks for pointing this out @zcorpan the rational here was talked about a lot in open ui, but the high level gist is that since the parsing for select was changed to allow for anything, the role of the popup needs to let users know whether they're interacting with a version that follows the content model (and thus can be exposed as a listbox) or has elements in it which are important to make AT users aware of / doesn't follow the content model, and thus was decided to be exposed as a dialog to help surface this to users. with that said though, i talked with @mfreed7 about this and we were thinking that to mitigate this explicit reference to the content model, we this can be updated to more overtly call out what HTML elements / allowed implicit roles will allow for the default role=listbox, and how the inclusion of others would result in the popup needing to be role=dialog.
Contributor
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. While I understand why it's being proposed, this is the part of customisable select accessibility that worries me the most. Mutations are a big concern here. What if the Perhaps we could state that the role is determined based on the initial rendering of the If we do want to handle mutations from valid to invalid and vice versa, there are some difficult issues we need to address:
CC @eeejay for awareness and input, since he will likely be doing the Gecko implementation for this and has also done some recent work regarding role calculation. CC also @lucasradaelli from Chrome accessibility, since aleventhal is no longer working on that. 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. I agree that this is a pain point. 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. In the hypothetical here that the select has a mix of invalid elements and 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. My humble proposal:
|
||
|
|
||
| <p> | ||
| In the event invalid elements are present, but are not rendered, then no user agent role repair is necessary.</p> | ||
| <p> | ||
| In the event that invalid elements are present, but are empty, include only whitespace, or are only used as wrapping elements for the valid descendent element's of a select, then user agents SHOULD ignore these elements in the accessibility tree. | ||
|
Contributor
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 is even more concerning. It's probably feasible to do this for empty elements in the initially rendered subtree. It's slightly trickier (but probably still feasible) to do this when new empty elements are inserted into an otherwise valid select. But what if someone inserts an empty Also, does "include only whitespace" explicitly refer to direct children or is this suggesting that we need to evaluate the contents overall. For example, does 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. I'm not sure why empty invalid tags are an exception here. What is the use-case? In my proposal above, I could see an empty invalid tag as a method of insuring the picker gets a role of dialog even if there is no initial content, eg: <select>
<button>
<selectedcontent>Select a pet:</selectedcontent>
</button>
<article></article>
</select> |
||
| </p> | ||
|
|
||
|
scottaohara marked this conversation as resolved.
Resolved
|
||
| <div class=example> | ||
| <p>In the following example the declared `article` elements are invalid per the `select` element's content model. But as each `article` element is empty, contains only whitespace, or contains only valid `option` elements, the `article` element's role can be ignored in the user agent's accessibility tree:</p> | ||
|
|
||
| <pre><code> | ||
| <select> | ||
| <button><selectedcontent></selectedcontent></button> | ||
| <article> </article> <!-- empty / containing only white space so can be ignored --> | ||
| <article> <!-- only contains option elements, so article role can be ignored --> | ||
| <option>item 1 | ||
| <option>item 2 | ||
| </article> | ||
| <article hidden> foo </article> <!-- article is in the hidden state, so is ignored --> | ||
| </select> | ||
| </code></pre> | ||
| </div> | ||
|
|
||
| <p class=note>Treating the picker as a `dialog` can help inform users that content beyond the expected elements of a `listbox` popup are present, as they can then inspect the content of the dialog with their assistive technology to discover such content.</p> | ||
|
|
||
| <p>See also <a href="#el-button-select-child">`button` element as a child of a `select` element.</p> | ||
|
Contributor
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. For better readability, should we move (or duplicate) the link to the 'button as a child of a select element' section closer to the second bullet point in the accessible name computation? It might help readers understand, for example, why an aria-label set on the button doesn’t contribute to the accessible name computation. |
||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
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.
Do you want to mention that the UA stylesheet applies
interactivity: inertto this button, to ensure that this comment is true (modulo developer shenanigans)?