Project

General

Profile

Actions

Feature #25231

open

Bug #25126: VPAT Initial Report

a11y improvements for admin bar implementation

Added by Boone Gorges 5 days ago. Updated 1 day ago.

Status:
New
Priority name:
Normal
Assignee:
Category name:
-
Target version:
Start date:
2026-07-10
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

The VPAT report has a number of items related to our customizations to the WP Admin Bar. Most of these have the form:

The Disclosure widget has the following issues:

The control to reveal the disclosure content is not exposed as a button (fails SC 4.1.2 Name, Role, Value (https://www.w3.org/TR/WCAG/#name-role-value))
The control to reveal the disclosure content does not have the correct states and properties, e.g., aria-expanded (fails SC 4.1.2 Name, Role, Value (https://www.w3.org/TR/WCAG/#name-role-value))

Ensure there is a button role either by making the control a <button> element or adding role=""button"" to the element
Add the aria-expanded attribute to the button. When content is expanded, aria-expanded=""true"", when it is collapsed, aria-expanded=""false""

A couple things to note here. First, we are using WP's native tools for adding submenus. The markup, JS, CSS all come from WP core. While this is not an argument that it's perfect, it does suggest that there may be some nuance to the issue (if it was totally broken, it would likely have been fixed or improved long ago).

More specifically, and perhaps more importantly for this specific issue, the review assumes that we intend to use a "button/disclosure" pattern here. I assume the reviewer interpreted the application this way because of the (default WP) behavior that hides submenus by default, and shows them on hover/activation of the parent menu item. But I would argue that this is not the only possible interpretation, nor even the best one. WP instead uses menu, menuitem, and related ARIA roles, indicating that the admin bar navigation is more akin to a nested menu rather than a series of independent disclosures. Here's a couple of relevant tickets from a quick look at WP Trac that indicate the intention: https://core.trac.wordpress.org/ticket/34668, https://core.trac.wordpress.org/ticket/43633, https://core.trac.wordpress.org/ticket/60919. The discussion on the first of these is especially helpful, and indicates that the WP team is aware of the limitations of using 'menu' roles for this purpose; see https://core.trac.wordpress.org/ticket/34668#comment:46.

So I think we should push back on the idea that we need to rewrite the toolbar implementation to use the disclosure pattern. Instead, I think we should explain a bit of the background in WP itself, and then propose a couple modest improvements that we can shim on top of WP:

- Add aria-haspopup="menu" to ab-item links with submenus. WP already does this in the wp-admin left-hand menu; see https://core.trac.wordpress.org/ticket/43095
- Add 'menu_title' when registering our custom top-level nodes like 'My Sites'. WP will then use this value to render the submenu ul with an aria-label, which helps to express the relationship between the parent and the popup.

I'm presenting this here first so that I can get feedback from Jeremy and Ray about the approach.

Actions #1

Updated by Boone Gorges 2 days ago

I wanted to note other items- 510152-01, 510152-03, 510152-04 - which are about unordered-list semantics in the adminbar. This is another area where we are simply inheriting what WP uses, and I think we can probably push back against having to make mods.

Actions #2

Updated by Boone Gorges 1 day ago

Another family of issues worth pushing back on is the fact that the Toolbar markup is at the end of the document, so that WP uses a skip link rather than relying on natural tab order. See 510157-01

Actions #3

Updated by Raymond Hoh 1 day ago

So I think we should push back on the idea that we need to rewrite the toolbar implementation to use the disclosure pattern. Instead, I think we should explain a bit of the background in WP itself, and then propose a couple modest improvements that we can shim on top of WP

I'm in agreement here. I noted the issues briefly in my initial outline, but if, and when, WordPress does do further accessibility improvements to the admin bar, we will inherit these improvements for free. Boone, your modest improvements will help, at least, placate some of the accessibility issues reported by Vispero.

Actions

Also available in: Atom PDF