progressbar-name-present
Progress bars have an accessible name
Checks that elements with role="progressbar" expose a non-empty accessible name.
Applies to. Applies to elements whose role attribute resolves to progressbar: its first token naming a known role, matched in any case, is progressbar, so role="foo progressbar" and role="PROGRESSBAR" count while role="link progressbar" (a link) does not. The element must be included in the accessibility tree. An element with the matching implicit role but no role attribute is out of scope. A custom element whose ElementInternals give it the role (this.attachInternals().role), with no role attribute naming another, is in scope too: that is its default role, and no other rule checks it.
Expectation. The element has a non-empty accessible name from aria-label, from an aria-labelledby that resolves to non-empty text, or from title. role="progressbar" is name-from-author-only, so subtree text is never accepted: text sitting inside a custom progressbar widget is not reliably exposed as its name. On a labelable element (<progress role="progressbar">) an associated <label> counts as well.
Examples
<div role="progressbar" aria-valuenow="50" aria-label="Upload progress"></div>
aria-label names the progress bar.
<div role="progressbar" aria-valuenow="50"></div>
No accessible name from any supported mechanism.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
name_internals
- Inspect the progress bar the report names, a custom element, and note its role.
- Open the Accessibility pane in the browser's developer tools and read the element's accessible name.
- With a screen reader, move to the element and listen to the name announced.
Pass. The accessibility tree shows a name for the progress bar, set through its internals or otherwise, and the screen reader announces it.
Fail. The progress bar has no name in the accessibility tree and the screen reader announces only its role, which fails WCAG 1.1.1.