Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexplained computation in glossary/accessible-name #33034

Closed
PassionPenguin opened this issue Apr 11, 2024 · 1 comment · Fixed by #33929
Closed

Unexplained computation in glossary/accessible-name #33034

PassionPenguin opened this issue Apr 11, 2024 · 1 comment · Fixed by #33929
Assignees
Labels
Content:Glossary Glossary entries

Comments

@PassionPenguin
Copy link
Contributor

MDN URL

https://developer.mozilla.org/en-US/docs/Glossary/Accessible_description

What specific section or headline is this issue about?

NA

What information was incorrect, unhelpful, or incomplete?

The computation of the section cannot be found in WAI:

The accessible description for a [<table>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) is its first [<caption>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption), for the [<figure>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure), is the [<figcaption>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption), for the [<summary>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary), is the content of the [<details>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) it is nested in, and for the button [<input>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) elements, it is the value attribute's value, unless the element also has a aria-describedby or aria-description attribute, which takes precedence.

For other elements, the description needs to be programmatically associated with the related element. In these cases, the accessible description is provided by the [aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) attribute, [aria-description](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-description) attribute, or the [title](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#title) attribute, if the title would not otherwise also be the [accessible name](https://developer.mozilla.org/en-US/docs/Glossary/Accessible_name) for that element, in that order of precedence.

As for WAI-ARIA, the current spec for accessible description computation, I can only know that the the computation is:

If [aria-describedby](https://www.w3.org/TR/2014/REC-wai-aria-20140320/states_and_properties#aria-describedby) is present, [user agents](https://www.w3.org/TR/2014/REC-wai-aria-implementation-20140320/#def_useragent) MUST compute the accessible description by concatenating the text alternatives for nodes referenced by an aria-describedby attribute on the current node. The text alternatives for the referenced nodes are computed using a number of methods, outlined below in the section titled [Text Alternative Computation](https://www.w3.org/TR/2014/REC-wai-aria-implementation-20140320/#mapping_additional_nd_te).

The computation by aria-description, host language feature are not found in that spec. It seems that the author did mixed with HTML-AAM which is still in draft.

If the content is about a spec in draft, then it still have problem that <figure> computation does not match that draft.

What did you expect to see?

If aria-describedby is present, user agents MUST compute the accessible description by concatenating the text alternatives for nodes referenced by an aria-describedby attribute on the current node. The text alternatives for the referenced nodes are computed using a number of methods, outlined below in the section titled Text Alternative Computation.

Do you have any supporting links, references, or citations?

Spec

WAI-ARIA 5.6.1.2

Draft

Do you have anything more you want to share?

No response

@PassionPenguin PassionPenguin added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 11, 2024
@github-actions github-actions bot added Content:Accessibility Accessibility docs Content:Glossary Glossary entries Content:HTML Hypertext Markup Language docs labels Apr 11, 2024
@PassionPenguin
Copy link
Contributor Author

PassionPenguin commented Apr 11, 2024

I was just doing some translation and editing, as just when I write the stuff below, I found that these precedence and orders are still in DRAFT. The attribute aria-description even not appeared in the WAI-ARIA page.

Accessible Description Computation

HTML

For HTML elements, the description needs to be programmatically associated with the related element. The order is as follows:

  1. aria-describedby attribute;
  2. aria-description attribute;
  3. by host language features which participate in the description calculation, if it would not otherwise also be the {{glossary("accessible name")}} for that element. Host language features are defined in HTML-AAM, SVG-AAM, or other host language documentation for more information on markup that defines a text alternative.
  4. title attribute, if it would not otherwise also be the {{glossary("accessible name")}} for that element.

For the host language features in HTML that participate in the description calculation, they are (as defined in HTML-AAM):

  1. {htmlelement("table")}}: its first {{htmlelement("caption")}}.
  2. {{htmlelement("summary")}}: the content of {{htmlelement("details")}} it is nested in.
  3. {{htmlelement("input")}} buttons(with type attribute button, submit or reset): the value attribute's value.

SVG

For SVG elements, the description needs to be programmatically associated with the related element. The order is as follows (as defined in SVG-AAM):

  1. aria-describedby attribute;
  2. a direct child desc element
  3. for text container elements, the text content
  4. a direct child title element that provides a tooltip, when ARIA label attributes are used to provide the accessible name
  5. xlink:title attribute on a link, if not used to provide the accessible name

Descriptions are reduced to text strings. For example, if an element's aria-describedby attribute value is the id of an HTML {{htmlelement("img")}}, the description is the description of the image (usually the image's alt attribute).

You can inspect the accessible description for any element on your page: look at your browser's developer tools' accessibility tab, which provides the accessibility information for the currently selected element.

See also

estelle added a commit that referenced this issue Jun 5, 2024
@estelle estelle self-assigned this Jun 5, 2024
@estelle estelle removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 5, 2024
@Josh-Cena Josh-Cena removed Content:HTML Hypertext Markup Language docs Content:Accessibility Accessibility docs labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Glossary Glossary entries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants