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: legend to provide name to optgroup #2360

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all 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
45 changes: 41 additions & 4 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4647,7 +4647,10 @@ <h4 id="el-legend">`legend`</h4>
</th>
<td>
<div class="role"><span class="type">Roles:</span> `ROLE_SYSTEM_STATICTEXT`; `IA2_ROLE_LABEL`</div>
<div class="relations"><span class="type">Relations:</span> `IA2_RELATION_LABEL_FOR` with the parent <a href="#el-fieldset">`fieldset`</a></div>
<div class="relations">
<span class="type">Relations:</span> `IA2_RELATION_LABEL_FOR` with the parent <a href="#el-fieldset">`fieldset`</a>
or <a href="#el-optgroup">`optgroup`</a>
</div>
</td>
</tr>
<tr>
Expand All @@ -4657,7 +4660,8 @@ <h4 id="el-legend">`legend`</h4>
<div class="properties">
<span class="type">Other properties:</span>
The `LabeledBy` property for the parent
<a href="#el-fieldset">`fieldset`</a> points to the UIA element for the `legend` element.
<a href="#el-fieldset">`fieldset`</a> or <a href="#el-optgroup">`optgroup`</a> points to the
UIA element for the `legend` element.
</div>
</td>
</tr>
Expand All @@ -4667,7 +4671,8 @@ <h4 id="el-legend">`legend`</h4>
<div class="role"><span class="type">Role:</span> `ATK_ROLE_LABEL`</div>
<div class="relations">
<span class="type">Relations:</span>
`ATK_RELATION_LABEL_FOR` with parent <a href="#el-fieldset">`fieldset`</a> element
`ATK_RELATION_LABEL_FOR` with parent <a href="#el-fieldset">`fieldset`</a>
or <a href="#el-optgroup">`optgroup`</a> element
</div>
</td>
</tr>
Expand Down Expand Up @@ -16141,12 +16146,34 @@ <h4>`fieldset` Element Accessible Name Computation</h4>
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then: if the `fieldset` element has a
<a href="https://dom.spec.whatwg.org/#concept-tree-child">child</a> that is a <code>legend</code> element, then use the subtree of the first such element.
<a href="https://dom.spec.whatwg.org/#concept-tree-child">child</a> that is a <code>legend</code> element, then use the subtree of the first such element in the accessibility tree.
</li>
<li>If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then:, if the `fieldset` element has a `title` attribute, then use that attribute.</li>
<li>Otherwise, there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li>
</ol>
</section>
<section>
<h4>`optgroup` Element Accessible Name Computation</h4>
<ol>
<li>
If the `optgroup` 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
scottaohara marked this conversation as resolved.
Show resolved Hide resolved
<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, then: if the `optgroup` element has a
<a data-cite="html/form-elements.html#attr-optgroup-label">label</a> attribute use the rendered value of that attribute.
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then: if the `optgroup` element has a
<a href="https://dom.spec.whatwg.org/#concept-tree-child">child</a> that is a <code>legend</code> element, then use the subtree of the first such element in the accessibility tree.
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then: if the `optgroup` element has a `title` attribute, then use that attribute.
</li>
<li>Otherwise, there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li>
</ol>
</section>
<section>
<h4>`output` Element Accessible Name Computation</h4>
<ol>
Expand Down Expand Up @@ -16349,6 +16376,16 @@ <h3>Accessible Description Computation</h3>
<a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the subtree of the first `caption` element if it was not used as the
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</li>
<li>
an `optgroup` element which has a visible label rendered by its `label` attribute, a <a href="https://dom.spec.whatwg.org/#concept-tree-child">child</a> `legend` element, or both:
<ol>
<li>use the value of the `label` attribute if it was not used as the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a></li>
<li>use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the subtree of the first `legend` element if it was not used as the
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li>
<li>or if both the `label` attribute and `legend` element were used, and their concatenate the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of each by DOM order, delimited by spaces,
if neither were used as the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>, and so long as the values of text equivalent computation of each do not match.</li>
</ol>
</li>
<li>
a `summary` element, use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of its subtree if it was not used as the
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
Expand Down
Loading