Make WordPress Core


Ignore:
Timestamp:
04/01/2019 03:07:30 PM (7 years ago)
Author:
afercia
Message:

Accessibility: Improve the Site Health accordions.

  • removes the definition list and uses the markup from the ARIA Authoring Practices example
  • removes incorrect ARIA roles
  • avoids ARIA landmark regions proliferation

Props mukesh27 for the initial patch.
Fixes #46714.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/site-health-info.php

    r45076 r45087  
    9696        </div>
    9797
    98         <dl id="health-check-debug" role="presentation" class="health-check-accordion">
     98        <div id="health-check-debug" class="health-check-accordion">
    9999
    100100                <?php
     
    104104                        }
    105105                        ?>
    106                         <dt role="heading" aria-level="3">
    107                                 <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" id="health-check-accordion-heading-<?php echo esc_attr( $section ); ?>" type="button">
    108                 <span class="title">
    109                         <?php echo esc_html( $details['label'] ); ?>
     106                        <h3 class="health-check-accordion-heading">
     107                                <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button">
     108                                        <span class="title">
     109                                                <?php echo esc_html( $details['label'] ); ?>
    110110
    111                         <?php if ( isset( $details['show_count'] ) && $details['show_count'] ) : ?>
    112                                 <?php printf( '(%d)', count( $details['fields'] ) ); ?>
    113                         <?php endif; ?>
    114                 </span>
     111                                                <?php if ( isset( $details['show_count'] ) && $details['show_count'] ) : ?>
     112                                                        <?php printf( '(%d)', count( $details['fields'] ) ); ?>
     113                                                <?php endif; ?>
     114                                        </span>
    115115                                        <span class="icon"></span>
    116116                                </button>
    117                         </dt>
     117                        </h3>
    118118
    119                         <dd id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" role="region" aria-labelledby="health-check-accordion-heading-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden">
     119                        <div id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden">
    120120                                <?php
    121121                                if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
     
    162162                                        </tbody>
    163163                                </table>
    164                         </dd>
     164                        </div>
    165165                <?php } ?>
    166         </dl>
     166        </div>
    167167</div>
    168168
Note: See TracChangeset for help on using the changeset viewer.