Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31942 closed defect (bug) (fixed)

Press This: add ARIA role alert to the "alerts" div

Reported by: afercia's profile afercia Owned by: azaozz's profile azaozz
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Press This Keywords: has-patch
Focuses: accessibility Cc:


Press This has a "notification" area where important messages are displayed. As far as I see for the most part they're errors, though there's the possibility to display also simple "notices". Examples:

"Content, title, and excerpt are empty."
"Connection lost or the server is busy. Please try again later."

Since these messages are displayed at the top of the screen while focus is on other parts of the UI, they won't be announced by assistive technologies.

ARIA roles can help us and since for now these messages are errors (any notices planned?) I'd suggest to add role "alert". Unlike elements with the role "status", elements with the role "alert" have an implicit aria-live value of assertive. From the specs:

This information has the highest priority and assistive technologies SHOULD notify the user immediately. Because an interruption may disorient users or cause them to not complete their current task, authors SHOULD NOT use the assertive value unless the interruption is imperative.

(Background change) Assistive technologies SHOULD announce updates at the next graceful opportunity, such as at the end of speaking the current sentence or when the user pauses typing.

If notices will be introduced in the future, we could iterate and use different roles depending on the nature of the message conveyed.

Please consider that while the role alert has an implicit aria-live value of assertive, and an implicit aria-atomic value of true, it's better to set them explicitly (as already done for wp.a11y.speak) for backwards compatibility with old AT:

role="alert" aria-live="assertive" aria-relevant="all" aria-atomic="true"

Attachments (1)

31942.patch (694 bytes) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (7)

9 years ago

#1 @afercia
9 years ago

  • Keywords has-patch added

#2 @helen
9 years ago

  • Milestone changed from Awaiting Review to 4.2

#3 @DrewAPicture
9 years ago

  • Owner set to azaozz
  • Status changed from new to assigned

#4 @azaozz
9 years ago

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

In 32102:

Press This: add ARIA attributes to the alerts container.
Props afercia. Fixes #31942.

#5 @azaozz
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

We added the ARIA attributes but having a hidden notice in that wrapper is still no good. The "You should upgrade your bookmarklet" notice can be added from PHP only when needed.

#6 @azaozz
9 years ago

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

In 32106:

Press This: check the bookmarklet version and add the update notice from PHP.
Fixes #31942.

Note: See TracTickets for help on using tickets.