Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
- Updates the listed inputs and button types to steps more consistent in wording.
- incorporates w3c/accname#246 into the label steps for the mentioned form controls
- starting to migrate from just using "subtree" to "text equivalent computation of the element's subtree" - as the simple use of 'subtree' has come up in a handful of reviews for html aam naming steps

the "other form controls" is not touched in this update - as there are also other pending PRs - re select element - that start breaking that apart.
  • Loading branch information
scottaohara authored Dec 9, 2024
1 parent 5973a12 commit 03ddaad
Showing 1 changed file with 79 additions and 29 deletions.
108 changes: 79 additions & 29 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16051,64 +16051,102 @@ <h2>Accessible Name and Description Computation</h2>
<h3>Accessible Name Computations By HTML Element</h3>
<section>
<h4>
`input type="text"`, `input type="password"`, `input type="number"`, `input type="search"`,` input type="tel"`, `input type="email"`, `input type="url"` and `textarea` Element Accessible
`input type="text"`, `input type="password"`, `input type="number"`, `input type="search"`,` input type="tel"`, `input type="email"`, `input type="url"` and `textarea` Elements Accessible
Name Computation
</h4>
<ol>
<li>
If the control 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
If the control 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>
Otherwise use the associated `label` element or elements <a data-cite="accname-1.2/#dfn-accessible-name">accessible name(s)</a> - if more than one `label` is associated; concatenate by
DOM order, delimited by spaces.
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the associated `label` element's subtree
- if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
<p>
If the control is encapsulated by its `label` element, exclude the control's author specified or
user-entered value from its computed <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</p>
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the value of the control's `title` attribute.
</li>
<li>
Otherwise:
use the value of the control's <a href="#att-placeholder">placeholder</a> attribute.
</li>
<li>If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then: use the control's `title` attribute.</li>
<li>Otherwise use the control's <a href="#att-placeholder">placeholder</a> value.</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>
</section>
<section>
<h4>`input type="button"`, `input type="submit"` and `input type="reset"` Accessible Name Computation</h4>
<h4>`input type="button"`, `input type="submit"` and `input type="reset"` Elements Accessible Name Computation</h4>
<ol>
<li>
If the control 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
If the control 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>
Otherwise use the associated `label` element(s) <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>(s) - if more than one `label` is associated; concatenate by DOM order,
delimited by spaces.
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the associated `label` element's subtree
- if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
<p>
If the control is encapsulated by its `label` element, and the control has an author specified `value` or the lack of a `value`
has produced an <a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string to render,
then exclude either from the control's computed <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</p>
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the value of the control's `value` attribute.</li>
<li>
For `input type=submit` and `type=reset`:
if the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, and the `value` attribute is unspecified use the
<a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string respective to the input type.
For instance, a localized string of the word "submit" or "reset" respective to the type of `input`.
</li>
<li>Otherwise use the `value` attribute.</li>
<li>
For `input type=submit` and `type=reset`: if the prior steps do not yield a usable text string, and the `value` attribute is unspecified use the
<a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string respective to the input type.
Otherwise:
use the value of the control's `title` attribute.
</li>
<li>Otherwise, if the control still has no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> use `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>
</section>
<section>
<h4>`input type="image"` Accessible Name Computation</h4>
<h4>`input type="image"` Element Accessible Name Computation</h4>
<ol>
<li>
If the control 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
If the control 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>
Otherwise use the associated `label` element(s) <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>(s) - if more than one `label` is associated; concatenate by DOM order,
delimited by spaces.
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the associated `label` element's subtree
- if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
<p>
If the control is encapsulated by its `label` element, and the control has an `alt` attribute,
then exclude the attribute's value from the control's computed <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</p>
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the value of the control's `alt` attribute if present and its value is not the empty string.
</li>
<li>Otherwise use `alt` attribute if present and its value is not the empty string.</li>
<!-- NOTE: use of value attribute is invalid on input type=image, but it DOES contribute to the name if used -->
<!-- <li>Otherwise use `value` attribute.</li> -->
<li>Otherwise use `title` attribute if present and its value is not the empty string.</li>
<!-- NOTE: use of value attribute is invalid on input type=image, but it DOES contribute to the name if used.
if this were to be specified, it'd belong here in the steps -->
<li>
Otherwise if the previous steps do not yield a usable text string, use the
<a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string respective to the input type (an `input` in the `image` state represents a
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the value of the control's `title` attribute if present and its value is not the empty string.
</li>
<li>
Otherwise, if the previous steps do not yield a usable text string:
use the <a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string respective to the input type (an `input` in the `image` state represents a
<a data-cite="html/forms.html#concept-submit-button">submit button</a>). For instance, a localized string of the word "submit" or the words &quot;Submit Query&quot;.
</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>
Expand All @@ -16118,16 +16156,28 @@ <h4>`input type="image"` Accessible Name Computation</h4>
<h4>`button` Element Accessible Name Computation</h4>
<ol>
<li>
If the `button` 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
If the `button` 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>
Otherwise use the associated `label` element(s) <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>(s) - if more than one `label` is associated; concatenate by DOM order,
delimited by spaces.
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the associated `label` element's subtree
- if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
<p>
If the `button` element is encapsulated by its `label` element, ignore the `button` element's subtree from its computed
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
</p>
</li>
<li>
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty:
use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the element's subtree.
</li>
<li>
Otherwise:
use the value of the element's `title` attribute.
</li>
<li>Otherwise use the `button` element subtree.</li>
<li>Otherwise use `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>
</section>
Expand Down

0 comments on commit 03ddaad

Please sign in to comment.