From 6b7f68855bdc30158c6e575e99b6eeb8fdd21a6a Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 16 Jun 2016 21:51:27 +0000 Subject: [PATCH] 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 --- wp-includes/js/wp-a11y.js | 5 +---- wp-includes/js/wp-a11y.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/wp-includes/js/wp-a11y.js b/wp-includes/js/wp-a11y.js index 14f419a06b..3acca7ff99 100644 --- a/wp-includes/js/wp-a11y.js +++ b/wp-includes/js/wp-a11y.js @@ -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 = $( '
', { 'id': 'wp-a11y-speak-' + ariaLive, - 'role': role, 'aria-live': ariaLive, 'aria-relevant': 'additions text', 'aria-atomic': 'true', diff --git a/wp-includes/js/wp-a11y.min.js b/wp-includes/js/wp-a11y.min.js index 736d66447d..f2ccf0c504 100644 --- a/wp-includes/js/wp-a11y.min.js +++ b/wp-includes/js/wp-a11y.min.js @@ -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("
",{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); \ No newline at end of file +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("
",{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); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 3597f6e958..027c421a35 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.