Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46995 closed enhancement (invalid)

Notifications need ARIA `role` attribute of either `status` or `alert` for accessibility purposes

Reported by: dannylonglegs's profile dannylonglegs Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: accessibility Cc:


During a recent accessibility audit at Pressbooks, we were informed that in order for notifications to be accessible, they need and ARIA role of either status or alert.

role=alert documentation:

role=status documentation:

Examples in WP code:

These HTML elements, usually with the id="message" or class="error" should have ARIA roles.

Change History (6)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Administration

#2 @SergeyBiryukov
5 years ago

  • Focuses accessibility added

#3 @afercia
5 years ago

@dannylonglegs thanks for your report. It's important to note that role=status and role=alert are a specialized type of live regions. That is to say that using these roles on notifications that are rendered on page load won't have any effect. Assistive technologies won't announce the notifications content.


Quoting from the Aria Authoring Practices (emphasis mine):

Dynamically rendered alerts are automatically announced by most screen readers, and in some operating systems, they may trigger an alert sound. It is important to note that, at this time, screen readers do not inform users of alerts that are present on the page before page load completes.

W3C role=alert example:

The standard admin notices in WordPress are rendered during page load. They're usually placed close to the main H1 heading so, in a way, screen reader users can find them with some content exploration. Any suggestions to improve their discoverability after page load is very welcome. I guess there should be a standardized way to generate the notices to start with.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.

5 years ago

#5 @afercia
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 5.1.1 deleted

Discussed during today's accessibility bug scrub and agreed to close this ticket because "static" notifications rendered on page load won't benefit from an ARIA alert or status role.

Also, agreed to create a new ticket to address all the "dynamic" notifications, that is the ones that are rendered in the DOM "on the fly" and do need ARIA roles.

#6 @afercia
5 years ago

Follow up: #47111.

Note: See TracTickets for help on using tickets.