Accessibility: Remove the ARIA roles from the `wp.a11y.speak()` live regions.

When Firefox repaints some elements, NVDA may announce "alert" even when there's
no actual message dispatched to the live region. The NVDA implementation differs
from other screen readers and is currently under discussion. To avoid a subpar
user experience better to remove the roles since they're basically redundant.

Fixes #36289.

git-svn-id: https://develop.svn.wordpress.org/trunk@37734 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2016-06-16 21:50:39 +00:00
parent 174925b7a9
commit 0cda9e306c
1 changed files with 1 additions and 4 deletions

View File

@ -4,8 +4,7 @@ window.wp = window.wp || {};
'use strict'; 'use strict';
var $containerPolite, var $containerPolite,
$containerAssertive, $containerAssertive;
role;
/** /**
* Update the ARIA live notification area text node. * Update the ARIA live notification area text node.
@ -39,11 +38,9 @@ window.wp = window.wp || {};
*/ */
function addContainer( ariaLive ) { function addContainer( ariaLive ) {
ariaLive = ariaLive || 'polite'; ariaLive = ariaLive || 'polite';
role = 'assertive' === ariaLive ? 'alert' : 'status';
var $container = $( '<div>', { var $container = $( '<div>', {
'id': 'wp-a11y-speak-' + ariaLive, 'id': 'wp-a11y-speak-' + ariaLive,
'role': role,
'aria-live': ariaLive, 'aria-live': ariaLive,
'aria-relevant': 'additions text', 'aria-relevant': 'additions text',
'aria-atomic': 'true', 'aria-atomic': 'true',