Accessibility: Improve the way Internet Explorer 11 and JAWS announce fieldset legends.

When Internet Explorer encounters a non interactive element with a `tabindex`
attribute, it adds the element to the accessibility tree with a `role=group` and
an accessible name computed from the element. This prevents JAWS from announcing
any fieldset legend within the element.

- removes `tabindex="0"` from the content and the toolbar containers: these tabindex attributes are no longer needed
- removes `aria-label="Main content"` from the content container: not needed
- keeps the media modal focus fallback introduced in [38142] by making the `#wpbody-content` element focusable only when needed

Props stevefaulkner, aardrian.
Fixes #43154.

Built from https://develop.svn.wordpress.org/trunk@44639


git-svn-id: http://core.svn.wordpress.org/trunk@44470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2019-01-17 11:55:51 +00:00
parent e96ea8eab6
commit 3578f89900
5 changed files with 7 additions and 5 deletions

View File

@ -248,7 +248,7 @@ $current_screen->set_parentage( $parent_file );
?> ?>
<div id="wpbody-content" aria-label="<?php esc_attr_e( 'Main content' ); ?>" tabindex="0"> <div id="wpbody-content">
<?php <?php
$current_screen->render_screen_meta(); $current_screen->render_screen_meta();

View File

@ -438,7 +438,7 @@ class WP_Admin_Bar {
<?php if ( ! is_admin() ) { ?> <?php if ( ! is_admin() ) { ?>
<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a> <a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a>
<?php } ?> <?php } ?>
<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>" tabindex="0"> <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>">
<?php <?php
foreach ( $root->children as $group ) { foreach ( $root->children as $group ) {
$this->_render_group( $group ); $this->_render_group( $group );

View File

@ -4428,7 +4428,9 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
if ( null !== this.clickedOpenerEl ) { if ( null !== this.clickedOpenerEl ) {
this.clickedOpenerEl.focus(); this.clickedOpenerEl.focus();
} else { } else {
$( '#wpbody-content' ).focus(); $( '#wpbody-content' )
.attr( 'tabindex', '-1' )
.focus();
} }
this.propagate('close'); this.propagate('close');

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.1-beta1-44638'; $wp_version = '5.1-beta1-44639';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.