X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/53f4633144ed68c8b8fb5861f992b5489894a940..ef91a7f4f3c6468973e192335a27ec0e0faca0b5:/wp-includes/js/wp-a11y.js diff --git a/wp-includes/js/wp-a11y.js b/wp-includes/js/wp-a11y.js index 14f419a0..2507cbc2 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. @@ -21,6 +20,9 @@ window.wp = window.wp || {}; // Clear previous messages to allow repeated strings being read out. clear(); + // Ensure only text is sent to screen readers. + message = $( '

' ).html( message ).text(); + if ( $containerAssertive && 'assertive' === ariaLive ) { $containerAssertive.text( message ); } else if ( $containerPolite ) { @@ -39,11 +41,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',