WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/19/2019 04:12:44 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Accessibility: Make sure layout tables across the admin are correctly linearized.

Adds role="presentation" to the <table> elements used for layout purposes.

Ideally, HTML tables should be used for tabular data. When tables are used for layout purposes, it's important to remove any native semantics so that assistive technologies can correctly announce the table content in a linearized fashion.

Props greatislander, afercia.
Merges [45403] to the 5.2 branch.
See #46899.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-admin/user-edit.php

    r45140 r45834  
    256256<h2><?php _e( 'Personal Options' ); ?></h2>
    257257
    258 <table class="form-table">
     258<table class="form-table" role="presentation">
    259259        <?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
    260260    <tr class="user-rich-editing-wrap">
     
    386386<h2><?php _e( 'Name' ); ?></h2>
    387387
    388 <table class="form-table">
     388<table class="form-table" role="presentation">
    389389    <tr class="user-user-login-wrap">
    390390        <th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
     
    483483    <h2><?php _e( 'Contact Info' ); ?></h2>
    484484
    485     <table class="form-table">
     485    <table class="form-table" role="presentation">
    486486    <tr class="user-email-wrap">
    487487        <th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
     
    552552    <h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2>
    553553
    554 <table class="form-table">
     554<table class="form-table" role="presentation">
    555555<tr class="user-description-wrap">
    556556    <th><label for="description"><?php _e( 'Biographical Info' ); ?></label></th>
     
    608608
    609609    <h2><?php _e( 'Account Management' ); ?></h2>
    610 <table class="form-table">
     610<table class="form-table" role="presentation">
    611611<tr id="password" class="user-pass1-wrap">
    612612    <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
     
    729729            ?>
    730730    <h2><?php _e( 'Additional Capabilities' ); ?></h2>
    731 <table class="form-table">
     731<table class="form-table" role="presentation">
    732732<tr class="user-capabilities-wrap">
    733733    <th scope="row"><?php _e( 'Capabilities' ); ?></th>
Note: See TracChangeset for help on using the changeset viewer.