WordPress.org

Make WordPress Core

Changeset 21423


Ignore:
Timestamp:
08/05/2012 06:41:52 PM (9 years ago)
Author:
azaozz
Message:

Add "Skip to toolbar" accessibility shortcut, see #21471

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r21258 r21423  
    639639
    640640    $form  = '<form action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch">';
    641     $form .= '<input class="adminbar-input" name="s" id="adminbar-search" tabindex="10" type="text" value="" maxlength="150" />';
     641    $form .= '<input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />';
    642642    $form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';
    643643    $form .= '</form>';
  • trunk/wp-includes/class-wp-admin-bar.php

    r21259 r21423  
    349349        ?>
    350350        <div id="wpadminbar" class="<?php echo $class; ?>" role="navigation">
    351             <div class="quicklinks">
     351            <a id="wpadminbar-shortcut" href="#wp-toolbar" tabindex="1"><?php _e('Skip to toolbar'); ?></a>
     352            <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e('Top navigation toolbar.'); ?>">
    352353                <?php foreach ( $root->children as $group ) {
    353354                    $this->_render_group( $group );
     
    396397        $has_link  = ! empty( $node->href );
    397398
    398         $tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : 10;
     399        $tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : '';
     400        $aria_attributes = $tabindex ? 'tabindex="' . $tabindex . '"' : '';
    399401
    400402        $menuclass = '';
    401         $aria_attributes = 'tabindex="' . $tabindex . '"';
    402403
    403404        if ( $is_parent ) {
  • trunk/wp-includes/css/admin-bar.dev.css

    r21335 r21423  
    607607}
    608608
     609/* Skip link */
     610#wpadminbar #wpadminbar-shortcut {
     611    position: absolute;
     612    left: -1000em;
     613    top: -1000em;
     614    height: 1px;
     615    width: 1px;
     616    overflow: hidden;
     617    padding: 0;
     618    margin: 0;
     619}
     620
     621#wpadminbar #wpadminbar-shortcut:focus {
     622    left: 0;
     623    top: 0;
     624    height: auto;
     625    width: auto;
     626    display: block;
     627    padding: 10px 15px;
     628    background: #fff;
     629    color: #000;
     630    outline: none;
     631    z-index: 100000;
     632    text-shadow: none;
     633}
     634
    609635/**
    610636 * IE 6-targeted rules
Note: See TracChangeset for help on using the changeset viewer.