Skip to content

ariaLabelledByElements describes naming "generic container elements", a prohibited "generic" role by default? #43765

@TomStrepsil

Description

@TomStrepsil

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Element/ariaLabelledByElements

What specific section or headline is this issue about?

Element: ariaLabelledByElements property

What information was incorrect, unhelpful, or incomplete?

The introduction states:

The property is primarily intended to provide a label for elements that don't have a standard method for defining their accessible name. For example, this might be used to name a generic container element, such as a <div> or <span>

However the w3c spec states:

Authors MUST NOT specify aria-labelledby on an element which has an explicit or implicit WAI-ARIA role where aria-labelledby is prohibited

With "Roles which cannot be named (Name prohibited)" including:

generic

With <div> or <span> being given as the canonical example:

The generic role is intended for use as the implicit role of generic elements in host languages (such as HTML div or span)

The suggestion is that ariaLabelledByElements is a direct correspondence to aria-labelledby.

See also here.

What did you expect to see?

Perhaps a caveat around providing accessible names to prohibited roles? Or a reference on why ariaLabelledByControls is not a direct correspondence to aria-labelledby and thus is able to label these?

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

https://w3c.github.io/aria/#aria-labelledby
https://w3c.github.io/aria/#namefromprohibited
https://w3c.github.io/aria/#generic
https://w3c.github.io/aria/#accessibilityroleandproperties-correspondence
https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/#:~:text=generic,Prohibited

Do you have anything more you want to share?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions