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

New ARIA role: generic #12197

Merged
merged 2 commits into from
Jan 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions files/en-us/web/accessibility/aria/roles/generic_role/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 'ARIA: generic role'
slug: Web/Accessibility/ARIA/Roles/generic_role
tags:
- Accessibility
- ARIA
- roles
- Reference
- ARIA roles
- document structure role
---

The `generic` role creates a nameless container element which has no semantic meaning on its own.

> **Note:** The `generic` role is the implicit role of generic elements used by user agents. It is included here for completeness of documentation. It should not be used by web authors.

## Description

While ARIA is primarily used to express semantics, there are some elements that shouldn't expose a semantic name to assistive technologies. The `generic` role indicates an element's role is equivilent to that of the non-semantic {{HTMLElement('div')}} and {{HTMLElement('span')}} elements.

The `generic` role is intended for use as the implicit role of generic elements in host languages for use by user agents only; not for use by developers. Instead, to remove implicit accessibilty semantics, use [`presentation`](/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role) or `none`, the {{HTMLElement('div')}} and {{HTMLElement('span')}} elements that have no semantic meaning, or semantic container roles such as [`group`](/en-US/docs/Web/Accessibility/ARIA/Roles/group_role) to semantically group descendants in a named container.

Like an element with role `presentation`, an element with `role="generic"` can provide a limited number of accessible states and properties for its descendants, such as [`aria-live`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live) attributes. However, unlike elements with role `presentation`, `generic` elements are exposed in accessibility APIs so that assistive technologies can gather certain properties such as layout and bounds.

Because the generic role is nameless, the [`aria-labelledby`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby) and [`aria-label`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) attributes are prohibited. Because the role is generic, the [`aria-roledescription`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-roledescription) and [`aria-brailleroledescription`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-brailleroledescription) attributes are also prohibited.

> **Note:** The element with `role="generic"` should not have an accessible name or role description.

### Associated WAI-ARIA roles, states, and properties

None. If a global ARIA state and property is set, `generic` or `none` will be ignored, and the implicit role of the element will be used.


## Examples

This role is for use by user agents and not by developers. As such, no appropriate example exists.

## Specifications

| Specification | Status |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| {{SpecName("ARIA","#generic","ARIA: generic role")}} | {{Spec2('ARIA')}} |

## See Also

- HTML {{HTMLElement('div')}} and {{HTMLElement('span')}} elements
- [`presentation`](/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role) roles such as
- [`group`](/en-US/docs/Web/Accessibility/ARIA/Roles/group_role) role

<section id="Quick_links">

1. [**WAI-ARIA roles**](/en-US/docs/Web/Accessibility/ARIA/Roles)

{{ListSubpagesForSidebar("/en-US/docs/Web/Accessibility/ARIA/Roles")}}

</section>