suggested simplification · w3c/accname@ef5724a (original) (raw)

`@@ -294,7 +294,26 @@

Computation steps

`

294

294

`

`

295

295

`

`

296

296

`

`

297

``

`-

  • Otherwise, if computing a name, and if the 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

    `+

  • Otherwise, if the 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

    `+

    `

    ``

    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

    `+

  • Otherwise, if computing a name, and if the 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

    `

  • `

    318

    ``

    `-

  • 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").

    `

    ``

    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

    ``

    `-

  • Otherwise, if the 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

    ``

    `-

    `

    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

    `

  • Otherwise, if the 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

    `

      `

      345

      346

      `

    1. Set the accumulated text to the empty string.
    2. `