Support aria-description (#69) · w3c/accname@81361ec (original) (raw)
`@@ -200,22 +200,70 @@
Name and Description
`
200
200
`
`
201
201
`
aria-label
and aria-labelledby
[=attribute=], or a host language labeling mechanism, such as the alt
or title
[=attribute=] in HTML, or the desc
[=element=] in SVG. `
202
202
`
`
203
``
`-
`
``
203
`+
`
204
204
`
`
205
205
`
aria-label
or aria-labelledby
attributes to name the element.`
206
206
`
`
207
207
`
The Accessible Rich Internet Applications (WAI-ARIA) 1.2 [[!WAI-ARIA]] specification provides lists of roles that support name from author, roles that support name from content and roles that cannot be named.
`
208
208
`
`
209
209
`
Name Computation
`
210
``
`-
User agents MUST compute an accessible name using the rules outlined below in the section titled Accessible Name and Description Computation.
`
``
210
`+
User agents MUST compute an accessible name using the rules outlined below in the section titled Text Equivalent Computation.
`
211
211
`
`
``
212
+
212
213
`
`
213
214
`
Description Computation
`
214
``
`-
If aria-describedby
is present, user agents MUST compute the accessible description by concatenating the text alternatives for elements referenced by an aria-describedby
attribute on the current element. The text alternatives for the referenced elements are computed using a number of methods, outlined below in the section titled Accessible Name and Description Computation.
`
``
215
`+
The following table provides the order of precedence for markup that can be applied to compute an accessible description. User agents MUST use the first applicable entry from the table where the listed conditions are met, as described in the last column. The user agent MUST NOT use any markup other that the first relevant markup found, even if that markup results in an empty description:
`
``
216
`+
Precedence | Attribute | Applicable conditions | How used to compute description |
---|---|---|---|
1 | aria-describedby attribute |
Use on any element | Text content computation on all nodes referenced by aria-describedby on the element, concatenated, and separated by a space character |
2 | aria-description attribute |
Use on any element | As a flat string |
3 | host language features which participate in the description calculation |
` ``
`+ Unique host language features MAY participate in the description computation for an element, only if they were not already used ` ``
`+ for the accessible name of the applicable element. See HTML AAM: Accessible Description Computation ` ``
`+ for the HTML elements which meet this condition. ` ``
`+ |
` ``
`+ Either a text equivalent computation of the element, or as a flat string of the attribute's value. ` ``
`+ |
4 | host language tooltip attribute or equivalent feature (e.g., HTML title attribute) |
` ``
`+
` ``
`+ ` ``
`+ ` ``
`+ ` ``
`+ |
As a flat string |
`
215
263
`
`
216
264
`
`
217
``
`-
Accessible Name and Description Computation
`
218
``
`-
The accessible name and description computation is used to generate both the accessible name and accessible description. There are different rules provided for several different types of [=element|elements=], [=nodes=], and combinations of markup. Text alternatives are built up, when appropriate, from all the relevant content contained within an [=element=]. This is accomplished via steps 2B and 2F, which are recursive, using the full set of rules to retrieve text from its own children or nodes it references.
`
``
265
`+
Text Equivalent Computation
`
``
266
`+
The text equivalent computation is used by both the accessible name and accessible description. There are different rules provided for several different types of [=element|elements=], [=nodes=], and combinations of markup. Text alternatives are built up, when appropriate, from all the relevant content contained within an [=element=]. This is accomplished via steps 2B and 2F, which are recursive, using the full set of rules to retrieve text from its own children or nodes it references.
`
219
267
`
The purpose of the computation is to create a perceivable label or description for alternative presentations, in the form of a flat string of space separated textual tokens.
`
220
268
`
`
221
269
`
Terminology
`
`@@ -308,8 +356,7 @@
Computation steps
`
308
356
`
`
309
357
`
`
310
358
`
- if computing a name, and the
current node
has anaria-labelledby
[=attribute=] that contains at least one valid IDREF, and thecurrent node
is not already part of anaria-labelledby
traversal, process its IDREFs in the order they occur: - or, if computing a description, and the
current node
has anaria-describedby
[=attribute=] that contains at least one valid IDREF, and thecurrent node
is not already part of anaria-describedby
traversal, process its IDREFs in the order they occur:`
``
359
`+
- if the
current node
has anaria-labelledby
[=attribute=] that contains at least one valid IDREF, and thecurrent node
is not already part of an ongoingaria-labelledby
oraria-describedby
traversal, process its IDREFs in the order they occur: - Set the
accumulated text
to the empty string. - For each IDREF:
- Otherwise, if computing a name, and if the
current node
has anaria-label
[=attribute=] whose value is not undefined, not the empty string, nor, when trimmed of [=ascii whitespace|whitespace=], is not the empty string:`
``
407
`+
- Otherwise, if the
current node
has anaria-label
[=attribute=] whose value is not undefined, not the empty string, nor, when trimmed of [=ascii whitespace|whitespace=], is not the empty string:`
361
408
`
- If traversal of the
current node
is due to recursion and thecurrent node
is an embedded control as defined in step 2C, ignorearia-label
and skip to rule 2C. - Otherwise, return the value of
aria-label
.
`
362
409
`
`
363
410
`
`
- If traversal of the
`
311
``
`-
`
312
``
`-
`
313
360
`
`
314
361
`
`
315
362
`
`
`@@ -357,7 +404,7 @@
Computation steps
`
357
404
`
<div role="checkbox" aria-checked="false">Flash the screen <span role="textbox" aria-multiline="false"> 5 </span> times</div>
`
358
405
`
`
359
406
`
`
360
``
`-