Accessibility: Remove title attributes and improve accessibility on the "no-js" Menus screen.

When JavaScript is off, the reorder menu item and Edit menu item links now use `aria-label`
attributes instead of title attributes.

Fixes #35134.
Built from https://develop.svn.wordpress.org/trunk@36016


git-svn-id: http://core.svn.wordpress.org/trunk@35981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2015-12-19 00:17:26 +00:00
parent 5787972a67
commit 67e1f55c4b
6 changed files with 49 additions and 13 deletions

View File

@ -618,6 +618,20 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
white-space: nowrap; white-space: nowrap;
} }
.no-js.nav-menus-php .item-edit {
position: static;
float: left;
width: auto;
height: auto;
margin-left: -10px !important;
padding: 12px 0;
color: #0073aa;
text-decoration: underline;
font-size: 12px;
line-height: 18px;
text-indent: 0;
}
.nav-menus-php .item-edit:before { .nav-menus-php .item-edit:before {
margin-top: 10px; margin-top: 10px;
margin-right: 4px; margin-right: 4px;
@ -627,6 +641,10 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
text-indent: -1px; /* account for the dashicon alignment */ text-indent: -1px; /* account for the dashicon alignment */
} }
.no-js.nav-menus-php .item-edit:before {
display: none;
}
.rtl .nav-menus-php .item-edit:before { .rtl .nav-menus-php .item-edit:before {
text-indent: 1px; /* account for the dashicon alignment */ text-indent: 1px; /* account for the dashicon alignment */
} }

View File

@ -618,6 +618,20 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
white-space: nowrap; white-space: nowrap;
} }
.no-js.nav-menus-php .item-edit {
position: static;
float: right;
width: auto;
height: auto;
margin-right: -10px !important;
padding: 12px 0;
color: #0073aa;
text-decoration: underline;
font-size: 12px;
line-height: 18px;
text-indent: 0;
}
.nav-menus-php .item-edit:before { .nav-menus-php .item-edit:before {
margin-top: 10px; margin-top: 10px;
margin-left: 4px; margin-left: 4px;
@ -627,6 +641,10 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
text-indent: -1px; /* account for the dashicon alignment */ text-indent: -1px; /* account for the dashicon alignment */
} }
.no-js.nav-menus-php .item-edit:before {
display: none;
}
.rtl .nav-menus-php .item-edit:before { .rtl .nav-menus-php .item-edit:before {
text-indent: 1px; /* account for the dashicon alignment */ text-indent: 1px; /* account for the dashicon alignment */
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -126,7 +126,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
), ),
'move-menu_item' 'move-menu_item'
); );
?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?>">&#8593;</abbr></a> ?>" class="item-move-up" aria-label="<?php esc_attr_e( 'Move up' ) ?>">&#8593;</a>
| |
<a href="<?php <a href="<?php
echo wp_nonce_url( echo wp_nonce_url(
@ -139,11 +139,11 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
), ),
'move-menu_item' 'move-menu_item'
); );
?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">&#8595;</abbr></a> ?>" class="item-move-down" aria-label="<?php esc_attr_e( 'Move down' ) ?>">&#8595;</a>
</span> </span>
<a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php esc_attr_e('Edit Menu Item'); ?>" href="<?php <a class="item-edit" id="edit-<?php echo $item_id; ?>" href="<?php
echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) ); echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
?>"><?php _e( 'Edit Menu Item' ); ?></a> ?>" aria-label="<?php esc_attr_e( 'Edit menu item' ); ?>"><?php _e( 'Edit' ); ?></a>
</span> </span>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-36015'; $wp_version = '4.5-alpha-36016';
/** /**
* 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.