suggested simplification · w3c/accname@ef5724a (original) (raw)
`@@ -294,7 +294,26 @@
Computation steps
`
294
294
`
`
295
295
`
`
296
296
`
`
297
``
`-
current node
has an aria-label
attribute whose value is not the empty string, nor, when trimmed of white space, is not the empty string:
`
``
297
`+
current node
is a control embedded within the label (e.g. the label
element in HTML or any element directly referenced by aria-labelledby
) for another widget, where the user can adjust the embedded control's value, then include the embedded control as part of the text alternative in the following manner:
`
``
298
`+
- If the embedded control has role textbox, return its value.
- If the embedded control has role menu button, return the text alternative of the button.
- If the embedded control has role combobox or listbox, return the text alternative of the chosen option.
- If the embedded control has role range (e.g., a spinbutton or slider):
`
``
303
`+
- If the
aria-valuetext
property is present, return its value, - Otherwise, if the
aria-valuenow
property is present, return its value, - Otherwise, use the value as specified by a host language attribute.
`
``
304
`+
`
``
305
`+
`
``
306
`+
`
``
307
`+
`
``
308
`+
- If the
`
``
299
`+
`
``
300
`+
`
``
301
`+
`
``
302
`+
`
``
309
`+
`
``
310
`+
`
``
311
`+
Example:
`
``
312
`+
Consider a check box label that contains a text input field: "Flash the screen [input] times". If the user has entered "5" for the embedded textbox, the complete label is "Flash the screen 5 times", e.g.:
`
``
313
`+
<div role="checkbox" aria-checked="false">Flash the screen <span role="textbox" aria-multiline="false"> 5 </span> times</div>
`
``
314
`+
`
``
315
`+
`
``
316
`+
current node
has an aria-label
attribute whose value is not the empty string, nor, when trimmed of white space, is not the empty string:
`
298
317
`
- If traversal of the
current node
is due to recursion and thecurrent node
is an embedded control as defined in step 2E, ignorearia-label
and skip to rule 2E. - Otherwise, return the value of
aria-label
.
`
299
318
`
`
300
319
`
`
`@@ -315,31 +334,13 @@
Computation steps
`
315
334
`</ul>
`
316
335
`
`
317
336
`
`
318
``
`-
current node
's native markup provides an attribute (e.g. title
) or element (e.g. HTML label
) that defines a text alternative, return that alternative in the form of a flat string
as defined by the host language, unless the element is marked as presentational (role="presentation"
or role="none"
).
`
``
337
`+
`
``
338
`+
Otherwise, if the current node
's native markup provides an attribute (e.g. title
) or element (e.g. HTML label
) that defines a text alternative, return that alternative in the form of a flat string
as defined by the host language, unless the element is marked as presentational (role="presentation"
or role="none"
).
`
319
339
`
`
320
340
`Comment:
`
321
341
`
For example, in HTML, the img
element's alt
attribute defines a text alternative string, and the label
element provides text for the referenced form element. In SVG2, the desc
and title
elements provide a description of their parent element.
`
322
342
`
`
323
343
`
`
324
``
`-
current node
is a control embedded within the label (e.g. the label
element in HTML or any element directly referenced by aria-labelledby
) for another widget, where the user can adjust the embedded control's value, then include the embedded control as part of the text alternative in the following manner:
`
325
``
`-
- If the embedded control has role textbox, return its value.
- If the embedded control has role menu button, return the text alternative of the button.
- If the embedded control has role combobox or listbox, return the text alternative of the chosen option.
- If the embedded control has role range (e.g., a spinbutton or slider):
`
330
``
`-
- If the
aria-valuetext
property is present, return its value, - Otherwise, if the
aria-valuenow
property is present, return its value, - Otherwise, use the value as specified by a host language attribute.
`
331
``
`-
`
332
``
`-
`
333
``
`-
`
334
``
`-
`
335
``
`-
- If the
`
326
``
`-
`
327
``
`-
`
328
``
`-
`
329
``
`-
`
336
``
`-
`
337
``
`-
`
338
``
`-
Example:
`
339
``
`-
Consider a check box label that contains a text input field: "Flash the screen [input] times". If the user has entered "5" for the embedded textbox, the complete label is "Flash the screen 5 times", e.g.:
`
340
``
`-
<div role="checkbox" aria-checked="false">Flash the screen <span role="textbox" aria-multiline="false"> 5 </span> times</div>
`
341
``
`-
`
342
``
`-
`
343
344
`
current node's
role allows name from content, or if the current node
is referenced by aria-labelledby
, aria-describedby
, or is a native host language text alternative element (e.g. label
in HTML), or is a descendant of a native host language text alternative element:`
344
345
`
- Set the
accumulated text
to the empty string.
`
345
346
`
`