Make WordPress Core


Ignore:
Timestamp:
06/30/2020 01:54:40 PM (5 years ago)
Author:
afercia
Message:

Accessibility: Privacy: Accessibility improvements for the Privacy Policy Guide page.

Improves accessibility of the "Copy this section" button and "Return to Top" link:

  • uses setTimeout() and clearTimeout() to properly handle the "Copied!" text
  • simplifies the button text by removing the redundant visually hidden text
  • fixes the mismatching visual and DOM order of the Copy button and the "Return to Top" link
  • improves the "Return to Top" links by providing real page fragment identifiers, when possible
  • hides the "Return to Top" up arrow from assistive technologies
  • minor coding standards

Props afercia, garrett-eclipse.
See #48463, #50322.
Fixes #50335.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/privacy-tools.php

    r48127 r48234  
    279279
    280280    if ( 1 < $groups_count ) {
    281         $group_html .= '<div class="return_to_top">';
    282         $group_html .= '<a href="#top">' . esc_html__( '&uarr; Return to top' ) . '</a>';
     281        $group_html .= '<div class="return-to-top">';
     282        $group_html .= '<a href="#top"><span aria-hidden="true">&uarr; </span> ' . esc_html__( 'Return to top' ) . '</a>';
    283283        $group_html .= '</div>';
    284284    }
     
    424424    fwrite( $file, 'td { padding: 5px; }' );
    425425    fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' );
    426     fwrite( $file, '.return_to_top { text-align:right; }' );
     426    fwrite( $file, '.return-to-top { text-align: right; }' );
    427427    fwrite( $file, '</style>' );
    428428    fwrite( $file, '<title>' );
Note: See TracChangeset for help on using the changeset viewer.