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.
Built from https://develop.svn.wordpress.org/trunk@37734


git-svn-id: http://core.svn.wordpress.org/trunk@37699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2016-06-16 21:51:27 +00:00
parent 5533b3f6c3
commit 6b7f68855b
3 changed files with 3 additions and 6 deletions

View File

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

View File

@ -1 +1 @@
window.wp=window.wp||{},function(a,b){"use strict";function c(a,b){e(),g&&"assertive"===b?g.text(a):f&&f.text(a)}function d(a){a=a||"polite",h="assertive"===a?"alert":"status";var c=b("<div>",{id:"wp-a11y-speak-"+a,role:h,"aria-live":a,"aria-relevant":"additions text","aria-atomic":"true","class":"screen-reader-text wp-a11y-speak-region"});return b(document.body).append(c),c}function e(){b(".wp-a11y-speak-region").text("")}var f,g,h;b(document).ready(function(){f=b("#wp-a11y-speak-polite"),g=b("#wp-a11y-speak-assertive"),f.length||(f=d("polite")),g.length||(g=d("assertive"))}),a.a11y=a.a11y||{},a.a11y.speak=c}(window.wp,window.jQuery);
window.wp=window.wp||{},function(a,b){"use strict";function c(a,b){e(),g&&"assertive"===b?g.text(a):f&&f.text(a)}function d(a){a=a||"polite";var c=b("<div>",{id:"wp-a11y-speak-"+a,"aria-live":a,"aria-relevant":"additions text","aria-atomic":"true","class":"screen-reader-text wp-a11y-speak-region"});return b(document.body).append(c),c}function e(){b(".wp-a11y-speak-region").text("")}var f,g;b(document).ready(function(){f=b("#wp-a11y-speak-polite"),g=b("#wp-a11y-speak-assertive"),f.length||(f=d("polite")),g.length||(g=d("assertive"))}),a.a11y=a.a11y||{},a.a11y.speak=c}(window.wp,window.jQuery);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37730';
$wp_version = '4.6-alpha-37734';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.