Make WordPress Core

Opened 21 months ago

Closed 18 months ago

Last modified 7 months ago

#60919 closed defect (bug) (fixed)

Accessibility issue in WordPress adminbar

Reported by: heinperu's profile heinperu Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.5
Component: Toolbar Keywords: has-patch has-test-info has-screenshots commit
Focuses: accessibility Cc:

Description

When I run Lighthouse on my page on localhost, while being logged in, I receive these errors:

Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children.
Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. Learn more about roles and required children elements.
Failing Elements
ul#wp-admin-bar-root-default.ab-top-menu
ul#wp-admin-bar-root-default.ab-top-menu
li#wp-admin-bar-wp-logo.menupop
li#wp-admin-bar-site-name.menupop
li#wp-admin-bar-customize.hide-if-no-customize
ul#wp-admin-bar-top-secondary.ab-top-secondary.ab-top-menu
li#wp-admin-bar-search.admin-bar-search
li#wp-admin-bar-my-account.menupop.with-avatar

I have exported the report to this gist: https://googlechrome.github.io/lighthouse/viewer/?gist=bb3f031c03ece7bfd67e9b614d2b9c17.

Attachments (5)

Screenshot 2024-04-04 at 12.07.51.png (191.5 KB) - added by heinperu 21 months ago.
60919.diff (614 bytes) - added by joedolson 18 months ago.
Add role="group" to menu descendants.
60919.png (19.0 KB) - added by rcreators 18 months ago.
Tested the Patch. Works fine. Tested with NVDA. Also works great.
60919-patch.png (195.7 KB) - added by krupajnanda 18 months ago.
A11Y Test Score improvement.png (73.7 KB) - added by krupajnanda 18 months ago.

Download all attachments as: .zip

Change History (20)

#1 @sabernhardt
21 months ago

  • Component changed from Editor to Toolbar

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


20 months ago

#3 @joedolson
20 months ago

Looks like menuitem is supposed to be a direct descendant of menu, and it's not. We don't actually want the list item to be the direct descendant, but we can add role="group" to address this.

Related: #34668.

#4 @joedolson
20 months ago

  • Milestone changed from Awaiting Review to 6.6
  • Owner set to joedolson
  • Status changed from new to accepted

@joedolson
18 months ago

Add role="group" to menu descendants.

#5 @joedolson
18 months ago

  • Keywords has-patch needs-testing has-testing-info added

Though some of these are groups of only one item with no popup, they all need to have role of group, because the only allowed descendants of a menu are groups, separators, and menuitems.

Testing:

  • verify that all immediate descendants of the adminbar menu role have role="group".
  • Test with a screen reader to verify behavior is unchanged.

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


18 months ago

@rcreators
18 months ago

Tested the Patch. Works fine. Tested with NVDA. Also works great.

#7 @krupajnanda
18 months ago

  • Keywords has-screenshots added

With the given patch, there is an improvement in Accessibility Score and I can see the added changes are working as expected.

Test Report

Description

This report validates that the indicated patch works as expected. ✅

Patch tested: https://core.trac.wordpress.org/attachment/ticket/60919/60919.diff

Environment

  • WordPress: 6.6-beta2-58392-src
  • PHP: 8.2.15
  • Server: nginx/1.25.3
  • Database: mysqli (Server: 8.0.36 / Client: mysqlnd 8.2.15)
  • Browser: Chrome 125.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Four 1.1
  • MU Plugins:
    • Safe Autoloaded Options Limit Test (MU Plugin) 1.0
  • Plugins:
    • Test Reports 1.1.0

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Add as Attachment

#8 @joedolson
18 months ago

  • Keywords commit added; needs-testing removed

#9 @rajinsharwar
18 months ago

With Patch 60919.diff, the Accessibility Score has increased, and the error of "Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children.".

Test Report

Description

This report validates that the indicated patch works as expected. ✅

Patch tested: https://core.trac.wordpress.org/attachment/ticket/60919/60919.diff

Environment

  • WordPress: 6.6-beta2-58392-src
  • PHP: 8.3.0
  • Server: nginx
  • Database: mysqli
  • Browser: Chrome
  • OS: Windows (LightHouse test done on Mobile device)

Actual Results

  1. ✅ Issue resolved with patch.

Attachments

Before: https://img001.prntscr.com/file/img001/PIpGT_BoT4uIPyCv3RpzPg.png
After: https://img001.prntscr.com/file/img001/hL1gBjpsSPyTRYb1eHL_Fg.png

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


18 months ago

#11 @hellofromTonya
18 months ago

  • Owner changed from joedolson to hellofromTonya
  • Status changed from accepted to assigned

Prepping the commit now.

#12 @hellofromTonya
18 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58438:

Toolbar: Fix ARIA [role] on menu descendants.

Adds a role="group" to the WordPress admin bar menu list items to fix the following accessibility issue:

Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children.

Reference:

Follow-up to [42128], [21193], [19558].

Props heinperu, joedolson, krupajnanda, rajinsharwar, rcreators, sabernhardt.
Fixes #60919.

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


18 months ago

#15 @wordpressdotorg
7 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.