Skip to content

Commit 395e7a6

Browse files
Editorial: Clarify / make consistent naming steps for HTML form controls (#2395)
Co-authored-by: Hidde de Vries <[email protected]>
1 parent 80782a4 commit 395e7a6

File tree

1 file changed

+45
-22
lines changed

1 file changed

+45
-22
lines changed

html-aam/index.html

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16346,7 +16346,7 @@ <h2>Accessible Name and Description Computation</h2>
1634616346
<h3>Accessible Name Computations By HTML Element</h3>
1634716347
<section>
1634816348
<h4>
16349-
`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
16349+
`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
1635016350
Name Computation
1635116351
</h4>
1635216352
<ol>
@@ -16370,46 +16370,62 @@ <h4>
1637016370
</ol>
1637116371
</section>
1637216372
<section>
16373-
<h4>`input type="button"`, `input type="submit"` and `input type="reset"` Accessible Name Computation</h4>
16373+
<h4>`input type="button"`, `input type="submit"` and `input type="reset"` Elements Accessible Name Computation</h4>
1637416374
<ol>
1637516375
<li>
1637616376
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
1637716377
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is to be calculated using the algorithm defined in
1637816378
<a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
1637916379
</li>
1638016380
<li>
16381-
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,
16382-
delimited by spaces.
16381+
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
16382+
the associated `label` element's subtree - if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
16383+
<p>
16384+
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
16385+
<a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string to render, then exclude either from the control's computed
16386+
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
16387+
</p>
1638316388
</li>
16384-
<li>Otherwise use the `value` attribute.</li>
16389+
<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>
1638516390
<li>
16386-
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
16387-
<a href="https://infra.spec.whatwg.org/#implementation-defined">implementation defined</a> string respective to the input type.
16391+
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
16392+
<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
16393+
"reset" respective to the type of `input`.
1638816394
</li>
16389-
<li>Otherwise, if the control still has no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> use `title` attribute.</li>
16395+
<li>Otherwise: use the value of the control's `title` attribute.</li>
1639016396
<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>
1639116397
</ol>
1639216398
</section>
1639316399
<section>
16394-
<h4>`input type="image"` Accessible Name Computation</h4>
16400+
<h4>`input type="image"` Element Accessible Name Computation</h4>
1639516401
<ol>
1639616402
<li>
1639716403
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
1639816404
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is to be calculated using the algorithm defined in
1639916405
<a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
1640016406
</li>
1640116407
<li>
16402-
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,
16403-
delimited by spaces.
16408+
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
16409+
the associated `label` element's subtree - if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
16410+
<p>
16411+
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
16412+
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
16413+
</p>
16414+
</li>
16415+
<li>
16416+
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
16417+
string.
1640416418
</li>
16405-
<li>Otherwise use `alt` attribute if present and its value is not the empty string.</li>
16406-
<!-- NOTE: use of value attribute is invalid on input type=image, but it DOES contribute to the name if used -->
16407-
<!-- <li>Otherwise use `value` attribute.</li> -->
16408-
<li>Otherwise use `title` attribute if present and its value is not the empty string.</li>
16419+
<!-- NOTE: use of value attribute is invalid on input type=image, but it DOES contribute to the name if used.
16420+
if this were to be specified, it'd belong here in the steps -->
1640916421
<li>
16410-
Otherwise if the previous steps do not yield a usable text string, use the
16411-
<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
16412-
<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;.
16422+
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
16423+
string.
16424+
</li>
16425+
<li>
16426+
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
16427+
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
16428+
"submit" or the words &quot;Submit Query&quot;.
1641316429
</li>
1641416430
<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>
1641516431
</ol>
@@ -16423,11 +16439,18 @@ <h4>`button` Element Accessible Name Computation</h4>
1642316439
<a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
1642416440
</li>
1642516441
<li>
16426-
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,
16427-
delimited by spaces.
16442+
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
16443+
the associated `label` element's subtree - if more than one `label` is associated; concatenate their subtrees by DOM order, delimited by spaces.
16444+
<p>
16445+
If the `button` element is encapsulated by its `label` element, ignore the `button` element's subtree from its computed
16446+
<a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
16447+
</p>
1642816448
</li>
16429-
<li>Otherwise use the `button` element subtree.</li>
16430-
<li>Otherwise use `title` attribute.</li>
16449+
<li>
16450+
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
16451+
the element's subtree.
16452+
</li>
16453+
<li>Otherwise: use the value of the element's `title` attribute.</li>
1643116454
<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>
1643216455
</ol>
1643316456
</section>

0 commit comments

Comments
 (0)