Make WordPress Core


Ignore:
Timestamp:
03/14/2016 08:54:58 PM (9 years ago)
Author:
azaozz
Message:

wpLink: fix accessibility issues:

  • Add role=dialog and an aria-labelledby attribute to the modal container.
  • Change the modal title to h1.
  • Remove one   that gets read out as blank by screen readers.
  • Replace the Cancel link with a button.
  • Clean up unused CSS.

Props afercia.
Fixes #30468.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r36985 r36991  
    14041404        ?>
    14051405        <div id="wp-link-backdrop" style="display: none"></div>
    1406         <div id="wp-link-wrap" class="wp-core-ui" style="display: none">
     1406        <div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria-labelledby="link-modal-title">
    14071407        <form id="wp-link" tabindex="-1">
    14081408        <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
    1409         <div id="link-modal-title">
    1410             <?php _e( 'Insert/edit link' ) ?>
    1411             <button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
    1412         </div>
     1409        <h1 id="link-modal-title"><?php _e( 'Insert/edit link' ) ?></h1>
     1410        <button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
    14131411        <div id="link-selector">
    14141412            <div id="link-options">
     
    14221420                </div>
    14231421                <div class="link-target">
    1424                     <label><span>&nbsp;</span>
     1422                    <label><span></span>
    14251423                    <input type="checkbox" id="wp-link-target" /> <?php _e( 'Open link in a new tab' ); ?></label>
    14261424                </div>
     
    14291427        <div class="submitbox">
    14301428            <div id="wp-link-cancel">
    1431                 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>
     1429                <button type="button" class="button"><?php _e( 'Cancel' ); ?></button>
    14321430            </div>
    14331431            <div id="wp-link-update">
Note: See TracChangeset for help on using the changeset viewer.