Make WordPress Core


Ignore:
Timestamp:
10/13/2024 08:47:12 PM (7 months ago)
Author:
joedolson
Message:

Revisions: Improve accessibility of revisions selection.

Add aria-labelledby and aria-describedby attributes to revision slider selection handle. Add keyboard :focus state to revision slider handle. Move 'multiple revision' checkbox before the buttons panel, matching its visual order. Change diff Title and Content headings from h3 to h2 to correct headings hierarchy.

Props joedolson, rishishah, sarahricker, williamalexander, afercia.
Fixes #52303.

File:
1 edited

Legend:

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

    r57644 r59225  
    379379    </script>
    380380
     381    <script id="tmpl-revisions-slider-hidden-help" type="text/html">
     382        <h2 class="screen-reader-text"><?php esc_html_e( 'Select a revision' ); ?></h2>
     383        <p id="revisions-slider-hidden-help" hidden><?php esc_html_e( 'Change revision by using the left and arrow keys' ); ?></p>
     384    </script>
     385
    381386    <script id="tmpl-revisions-checkbox" type="text/html">
    382387        <div class="revision-toggle-compare-mode">
     
    398403            <div class="diff-title">
    399404                <# if ( 'from' === data.type ) { #>
    400                     <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
     405                    <strong id="diff-title-from"><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
    401406                <# } else if ( 'to' === data.type ) { #>
    402                     <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
     407                    <strong id="diff-title-to"><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
    403408                <# } #>
    404409                <div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
    405410                    {{{ data.attributes.author.avatar }}}
    406                     <div class="author-info">
     411                    <div class="author-info" id="diff-title-author">
    407412                    <# if ( data.attributes.autosave ) { #>
    408413                        <span class="byline">
     
    465470        <div class="diff">
    466471        <# _.each( data.fields, function( field ) { #>
    467             <h3>{{ field.name }}</h3>
     472            <h2>{{ field.name }}</h2>
    468473            {{{ field.diff }}}
    469474        <# }); #>
Note: See TracChangeset for help on using the changeset viewer.