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: option element mapping table #2365

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
72 changes: 61 additions & 11 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3901,10 +3901,10 @@ <h4 id="el-input-radio">`input` <span class="el-context">(`type` attribute in th
<th>[[wai-aria-1.2]]</th>
<td>
<a class="core-mapping" href="#role-map-radio">`radio`</a> role, with the <a class="core-mapping" href="#ariaCheckedTrue">`aria-checked`</a> state set to "true" if the element's
<a data-cite="html/form-control-infrastructure.html#concept-fe-checked">checkedness</a> is true, or "false" otherwise. With
<a href="https://www.w3.org/TR/core-aam-1.1/#ariaSetsize">`aria-setsize`</a> value reflecting number of `type=radio input` elements within the
<a data-cite="html/form-control-infrastructure.html#concept-fe-checked">checkedness</a> is true, or "false" otherwise.
Expose an <a href="https://www.w3.org/TR/core-aam-1.1/#ariaSetsize">`aria-setsize`</a> value reflecting number of `type=radio input` elements within the
<a data-cite="html/input.html#radio-button-group">radio button group</a>
and <a href="https://www.w3.org/TR/core-aam-1.1/#ariaPosinset">`aria-posinset`</a> value reflecting the elements position within the
and an <a href="https://www.w3.org/TR/core-aam-1.1/#ariaPosinset">`aria-posinset`</a> value reflecting the `type=radio input` element's position within the
<a data-cite="html/input.html#radio-button-group">radio button group</a>.
</td>
</tr>
Expand Down Expand Up @@ -5463,16 +5463,20 @@ <h4 id="el-option">`option` <span class="el-context">(in a list of options or re
<th>HTML Specification</th>
<td>
<a data-cite="html">`option`</a>
<span class="el-context"
>(in a <a data-cite="html/form-elements.html#concept-select-option-list">list of options</a> or represents a suggestion in a <a data-cite="html">`datalist`</a>)</span
>
<span class="el-context">
(in a <a data-cite="html/form-elements.html#concept-select-option-list">list of options</a> or represents a suggestion in a <a data-cite="html">`datalist`</a>)
</span>
</td>
</tr>
<tr>
<th>[[wai-aria-1.2]]</th>
<td>
<a class="core-mapping" href="#role-map-option">`option`</a> role, with the <a class="core-mapping" href="#ariaSelectedTrue">`aria-selected`</a> state set to "true" if the element's
<a data-cite="html/form-elements.html#concept-option-selectedness">selectedness</a> is true, or "false" otherwise.
Expose an <a href="https://www.w3.org/TR/core-aam-1.1/#ariaSetsize">`aria-setsize`</a> value reflecting the number of `option` elements within the
<a data-cite="html/form-elements.html#concept-select-option-list">list of options</a>
and an <a href="https://www.w3.org/TR/core-aam-1.1/#ariaPosinset">`aria-posinset`</a> value reflecting the `option` element's position within the
<a data-cite="html/form-elements.html#concept-select-option-list">list of options</a>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -5508,7 +5512,10 @@ <h4 id="el-option">`option` <span class="el-context">(in a list of options or re
<!-- <th><a href="#accessible-name-and-description-computation">Naming Algorithm</a></th> -->
<tr>
<th>Comments</th>
<td></td>
<td>
To repair instance of invalid nesting of interactive or keyboard focusable content within an `option` element, user agents MAY
expose the accessible name, role, states and properties of such an element when and if it receives focus.
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -11725,7 +11732,8 @@ <h4 id="att-label">`label`</h4>
<tr>
<th>Element(s)</th>
<td>
<a data-cite="html/form-elements.html#attr-optgroup-label">`optgroup`</a>; <a data-cite="html/form-elements.html#attr-option-label">`option`</a>;
<a data-cite="html/form-elements.html#attr-optgroup-label">`optgroup`</a>;
<a data-cite="html/form-elements.html#attr-option-label">`option`</a>;
<a data-cite="html/media.html#attr-track-label">`track`</a>
</td>
</tr>
Expand All @@ -11746,8 +11754,7 @@ <h4 id="att-label">`label`</h4>
<tr>
<th><a href="https://msdn.microsoft.com/en-us/library/ms726297%28v=VS.85%29.aspx">UIA</a></th>
<td>
The target element of the `label` attribute has a `LabeledBy` property pointing to the element with the `label` attribute. Participates in
<a href="#accname-computation">name computation.</a>
<div class="name">Associates the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a></div>
</td>
</tr>
<tr>
Expand All @@ -11762,7 +11769,20 @@ <h4 id="att-label">`label`</h4>
</tr>
<tr>
<th>Comments</th>
<td>See Also: <a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a></td>
<td>
<div class="note">
<p>The `label` attribute behaves differently when declared on an `optgroup` element compared to an `option` element.</p>
<p>If the `label` attribute is declared on an `option` element, its value will become the rendered label of the `option` element, even if the `option` element has child elements.</p>
<p>If the `label` attribute is declared on an `optgroup` element that is a descendant of a customizable `select` element, and that `optgroup` has a child `legend` element, then the `legend` element takes priority. The `label` attribute's value will not be rendered or exposed to the accessibility tree as the name of the `opgroup`.
</div>

<!--
FOR FUTURE PR https://github.com/w3c/html-aam/issues/568 :
The `label` attribute can also participate in the <a data-cite="accname-1.2/#dfn-accessible-description">accessible descriptions</a> of
an `option`, if the `option` is a child of a `datalist`.
See <a href="#accdesc-computation">accessible description computation</a> for more information.
-->
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -16198,6 +16218,32 @@ <h4>`fieldset` Element Accessible Name Computation</h4>
<li>Otherwise, there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li>
</ol>
</section>
<section>
<h4>`option` Element Accessible Name Computation</h4>
<ol>
<li>
If the `option` element has an <a data-cite="wai-aria-1.2/#aria-label">`aria-label`</a>
or an <a data-cite="wai-aria-1.2/#aria-labelledby">`aria-labelledby`</a> attribute the
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is to be calculated using the algorithm defined in
<a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty: use the value of the `option` element's `label` attribute.
</li>
<li>
If no `label` attribute is specified: use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the `option` element's subtree.
</li>
<li>
Otherwise:
use the value of the element's `title` attribute.
</li>
<li>If none of the above yield a usable text string there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li
</ol>
<p class="note">
An `option` element's `label` attribute will override the rendering of an `option` element's author defined descendents. Instead, the
value of the element's `label` attribute is used as the visible text label for the `option`.
</p>
</section>
<section>
<h4>`output` Element Accessible Name Computation</h4>
<ol>
Expand Down Expand Up @@ -16408,6 +16454,10 @@ <h3>Accessible Description Computation</h3>
an `input` element whose `type` attribute is the `button`, `submit` or `reset` state, and it has a `value` attribute, then use the flat string of the attribute if it was not used as
the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</li>
<!--
FOR FUTURE PR https://github.com/w3c/html-aam/issues/568 :
add what to do for an option with a label attribute and inner text content, when used within the context of a datalist
-->
</ul>
</li>
<li>Otherwise, use the flat string of the `title` attribute if it was not used as the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> for the element.</li>
Expand Down
Loading