Make WordPress Core

Changeset 45403


Ignore:
Timestamp:
05/24/2019 09:55:21 PM (5 years 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.
Fixes #46899.

Location:
trunk/src/wp-admin
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-background.php

    r45140 r45403  
    247247<h3><?php _e( 'Background Image' ); ?></h3>
    248248
    249 <table class="form-table">
     249<table class="form-table" role="presentation">
    250250<tbody>
    251251<tr>
     
    341341<h3><?php _e( 'Display Options' ); ?></h3>
    342342<form method="post">
    343 <table class="form-table">
     343<table class="form-table" role="presentation">
    344344<tbody>
    345345        <?php if ( get_background_image() ) : ?>
  • trunk/src/wp-admin/custom-header.php

    r45140 r45403  
    491491<h3><?php _e( 'Header Image' ); ?></h3>
    492492
    493 <table class="form-table">
     493<table class="form-table" role="presentation">
    494494<tbody>
    495495
     
    629629<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 1 ) ); ?>">
    630630        <?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>
    631 <table class="form-table">
     631<table class="form-table" role="presentation">
    632632<tbody>
    633633        <?php if ( get_uploaded_header_images() ) : ?>
     
    690690<h3><?php _e( 'Header Text' ); ?></h3>
    691691
    692 <table class="form-table">
     692<table class="form-table" role="presentation">
    693693<tbody>
    694694<tr>
  • trunk/src/wp-admin/edit-tag-form.php

    r44663 r45403  
    128128}
    129129?>
    130     <table class="form-table">
     130    <table class="form-table" role="presentation">
    131131        <tr class="form-field form-required term-name-wrap">
    132132            <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
  • trunk/src/wp-admin/includes/ms.php

    r45300 r45403  
    803803function choose_primary_blog() {
    804804    ?>
    805     <table class="form-table">
     805    <table class="form-table" role="presentation">
    806806    <tr>
    807807    <?php /* translators: My sites label */ ?>
     
    915915    $admin_out   = '<option value="' . esc_attr( $current_user->ID ) . '">' . $current_user->user_login . '</option>';
    916916    ?>
    917     <table class="form-table">
     917    <table class="form-table" role="presentation">
    918918    <?php
    919919    foreach ( ( $allusers = (array) $_POST['allusers'] ) as $user_id ) {
  • trunk/src/wp-admin/includes/network.php

    r45391 r45403  
    224224        <p><?php _e( 'You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality.' ); ?></p>
    225225        <?php // @todo: Link to an MS readme? ?>
    226         <table class="form-table">
     226        <table class="form-table" role="presentation">
    227227            <tr>
    228228                <th><label><input type="radio" name="subdomain_install" value="1"<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>
     
    273273        ?>
    274274        </p>
    275         <table class="form-table">
     275        <table class="form-table" role="presentation">
    276276            <tr>
    277277            <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
     
    290290
    291291        <h3><?php esc_html_e( 'Network Details' ); ?></h3>
    292         <table class="form-table">
     292        <table class="form-table" role="presentation">
    293293        <?php if ( 'localhost' == $hostname ) : ?>
    294294            <tr>
  • trunk/src/wp-admin/includes/template.php

    r44809 r45403  
    16061606            continue;
    16071607        }
    1608         echo '<table class="form-table">';
     1608        echo '<table class="form-table" role="presentation">';
    16091609        do_settings_fields( $page, $section['id'] );
    16101610        echo '</table>';
  • trunk/src/wp-admin/install.php

    r45357 r45403  
    114114<?php } ?>
    115115<form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
    116     <table class="form-table">
     116    <table class="form-table" role="presentation">
    117117        <tr>
    118118            <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th>
  • trunk/src/wp-admin/network/settings.php

    r45140 r45403  
    149149        <?php wp_nonce_field( 'siteoptions' ); ?>
    150150        <h2><?php _e( 'Operational Settings' ); ?></h2>
    151         <table class="form-table">
     151        <table class="form-table" role="presentation">
    152152            <tr>
    153153                <th scope="row"><label for="site_name"><?php _e( 'Network Title' ); ?></label></th>
     
    189189        </table>
    190190        <h2><?php _e( 'Registration Settings' ); ?></h2>
    191         <table class="form-table">
     191        <table class="form-table" role="presentation">
    192192            <tr>
    193193                <th scope="row"><?php _e( 'Allow new registrations' ); ?></th>
     
    278278        </table>
    279279        <h2><?php _e( 'New Site Settings' ); ?></h2>
    280         <table class="form-table">
     280        <table class="form-table" role="presentation">
    281281
    282282            <tr>
     
    359359        </table>
    360360        <h2><?php _e( 'Upload Settings' ); ?></h2>
    361         <table class="form-table">
     361        <table class="form-table" role="presentation">
    362362            <tr>
    363363                <th scope="row"><?php _e( 'Site upload space' ); ?></th>
     
    403403            ?>
    404404            <h2><?php _e( 'Language Settings' ); ?></h2>
    405             <table class="form-table">
     405            <table class="form-table" role="presentation">
    406406                <tr>
    407407                    <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
  • trunk/src/wp-admin/network/site-info.php

    r43571 r45403  
    153153    <?php wp_nonce_field( 'edit-site' ); ?>
    154154    <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
    155     <table class="form-table">
     155    <table class="form-table" role="presentation">
    156156        <?php
    157157        // The main site of the network should not be updated on this page.
  • trunk/src/wp-admin/network/site-new.php

    r44574 r45403  
    225225<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
    226226<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
    227     <table class="form-table">
     227    <table class="form-table" role="presentation">
    228228        <tr class="form-field form-required">
    229229            <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th>
  • trunk/src/wp-admin/network/site-settings.php

    r43571 r45403  
    112112    <?php wp_nonce_field( 'edit-site' ); ?>
    113113    <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
    114     <table class="form-table">
     114    <table class="form-table" role="presentation">
    115115        <?php
    116116        $blog_prefix = $wpdb->get_blog_prefix( $id );
  • trunk/src/wp-admin/network/site-users.php

    r43571 r45403  
    301301<form action="site-users.php?action=adduser" id="adduser" method="post">
    302302    <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
    303     <table class="form-table">
     303    <table class="form-table" role="presentation">
    304304        <tr>
    305305            <th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th>
     
    335335<form action="<?php echo network_admin_url( 'site-users.php?action=newuser' ); ?>" id="newuser" method="post">
    336336    <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
    337     <table class="form-table">
     337    <table class="form-table" role="presentation">
    338338        <tr>
    339339            <th scope="row"><label for="user_username"><?php _e( 'Username' ); ?></label></th>
  • trunk/src/wp-admin/network/user-new.php

    r43571 r45403  
    121121<?php } ?>
    122122    <form action="<?php echo network_admin_url( 'user-new.php?action=add-user' ); ?>" id="adduser" method="post" novalidate="novalidate">
    123     <table class="form-table">
     123    <table class="form-table" role="presentation">
    124124        <tr class="form-field form-required">
    125125            <th scope="row"><label for="username"><?php _e( 'Username' ); ?></label></th>
  • trunk/src/wp-admin/options-discussion.php

    r45401 r45403  
    4242<?php settings_fields( 'discussion' ); ?>
    4343
    44 <table class="form-table">
     44<table class="form-table" role="presentation">
    4545<tr>
    4646<th scope="row"><?php _e( 'Default post settings' ); ?></th>
     
    219219?>
    220220
    221 <table class="form-table">
     221<table class="form-table" role="presentation">
    222222<tr>
    223223<th scope="row"><?php _e( 'Avatar Display' ); ?></th>
  • trunk/src/wp-admin/options-general.php

    r45402 r45403  
    5959<?php settings_fields( 'general' ); ?>
    6060
    61 <table class="form-table">
     61<table class="form-table" role="presentation">
    6262
    6363<tr>
  • trunk/src/wp-admin/options-media.php

    r45140 r45403  
    5252<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>
    5353
    54 <table class="form-table">
     54<table class="form-table" role="presentation">
    5555<tr>
    5656<th scope="row"><?php _e( 'Thumbnail size' ); ?></th>
     
    9999    ?>
    100100<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
    101 <table class="form-table">
     101<table class="form-table" role="presentation">
    102102    <?php do_settings_fields( 'media', 'embeds' ); ?>
    103103</table>
     
    106106<?php if ( ! is_multisite() ) : ?>
    107107<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
    108 <table class="form-table">
     108<table class="form-table" role="presentation">
    109109    <?php
    110110    // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
  • trunk/src/wp-admin/options-permalink.php

    r45140 r45403  
    301301</p>
    302302
    303 <table class="form-table">
     303<table class="form-table" role="presentation">
    304304    <tr>
    305305        <th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e( 'Category base' ); ?></label></th>
  • trunk/src/wp-admin/options-reading.php

    r45401 r45403  
    6262<?php if ( ! get_pages() ) : ?>
    6363<input name="show_on_front" type="hidden" value="posts" />
    64 <table class="form-table">
     64<table class="form-table" role="presentation">
    6565    <?php
    6666    if ( 'posts' != get_option( 'show_on_front' ) ) :
     
    7373    }
    7474    ?>
    75 <table class="form-table">
     75<table class="form-table" role="presentation">
    7676<tr>
    7777<th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
  • trunk/src/wp-admin/options-writing.php

    r45140 r45403  
    6363<?php settings_fields( 'writing' ); ?>
    6464
    65 <table class="form-table">
     65<table class="form-table" role="presentation">
    6666<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
    6767<tr>
     
    151151</p>
    152152
    153 <table class="form-table">
     153<table class="form-table" role="presentation">
    154154<tr>
    155155<th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th>
  • trunk/src/wp-admin/options.php

    r43571 r45403  
    321321        <input type="hidden" name="action" value="update" />
    322322        <input type="hidden" name="option_page" value="options" />
    323         <table class="form-table">
     323        <table class="form-table" role="presentation">
    324324<?php
    325325$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
  • trunk/src/wp-admin/setup-config.php

    r45382 r45403  
    208208<form method="post" action="setup-config.php?step=2">
    209209    <p><?php _e( 'Below you should enter your database connection details. If you&#8217;re not sure about these, contact your host.' ); ?></p>
    210     <table class="form-table">
     210    <table class="form-table" role="presentation">
    211211        <tr>
    212212            <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th>
  • trunk/src/wp-admin/user-edit.php

    r45402 r45403  
    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>
  • trunk/src/wp-admin/user-new.php

    r45204 r45403  
    394394    <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
    395395
    396 <table class="form-table">
     396<table class="form-table" role="presentation">
    397397    <tr class="form-field form-required">
    398398        <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
     
    463463
    464464    ?>
    465 <table class="form-table">
     465<table class="form-table" role="presentation">
    466466    <tr class="form-field form-required">
    467467        <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
Note: See TracChangeset for help on using the changeset viewer.