Skip to content

Consider allowing label elements to provide a label for landmark elements #5812

Open
@carmacleod

Description

@carmacleod

Certain HTML elements (main, nav, aside, header, footer, section, form) can have implicit ARIA landmark semantics.

Two of these - section and form - will only have implicit ARIA landmark semantics if they have an accessible name.

  1. section element will have implied landmark role "region" if it has an accessible name:

    role=region if the section element has an accessible name.

  2. form element will have implied landmark role "form" if it has an accessible name:

    role=form if the form element has an accessible name.

At present, the only way to give a section or form element an accessible name is to use either the aria-label or aria-labelledby attribute.

This is a problem if a user agent wants to include section and form elements in landmark navigation. User agents shouldn't have to rely on the presence or absence of ARIA markup to determine whether or not to include an element in a new behavior.

The label element can provide an accessible name to form controls like input, select, etc.

Consider allowing it to provide an accessible name for section and form elements as well, so that these elements can participate in landmark navigation.

<label for="settings-section">Settings:</label>
<section id="settings-section"> ... </section>

<label for="contact-info-form">Contact information:</label>
<form id="contact-info-form"> ... </form>

Alternatively, consider allowing the label element to provide an accessible name for all of the landmark elements listed above. All of them are allowed to have an accessible name - it's only section and form that are required to have one in order to be considered landmarks. This would allow for something like:

<label for="site-nav">Site</label>
<nav id="site-nav"> ... </nav>

<label for="page-nav">Page</label>
<nav id="page-nav"> ... </nav>

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.accessibilityAffects accessibilityaddition/proposalNew features or enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions