Skip to content

Commit 1f519fd

Browse files
committed
Site Health: Improve HTML semantics for tables used in Site Health debug tab.
This changeset removes the `presentation` role from the Site Health debug tab tables to switch them into regular data tables, and updates the related stylesheet to keep the previously used styles. Props audrasjb, hbhalodia, rvouill, mukesh27, sabernhardt, joedolson, alexstine. Fixes #62880. git-svn-id: https://develop.svn.wordpress.org/trunk@59859 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1152b1a commit 1f519fd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/wp-admin/css/site-health.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ are styled in the Privacy section of edit.css */
166166
margin: 0 auto;
167167
}
168168

169+
.widefat.health-check-table th {
170+
font-size: 13px;
171+
}
172+
169173
.health-check-table td:first-child {
170174
width: 30%;
171175
}
@@ -337,13 +341,15 @@ are styled in the Privacy section of edit.css */
337341
table-layout: fixed;
338342
}
339343

344+
.health-check-table th,
340345
.health-check-table td {
341346
box-sizing: border-box;
342347
display: block;
343348
width: 100%;
344349
word-wrap: break-word;
345350
}
346351

352+
.widefat.health-check-table th,
347353
.health-check-table td:first-child {
348354
width: 100%;
349355
padding-bottom: 0;

src/wp-admin/site-health-info.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
}
109109

110110
?>
111-
<table class="widefat striped health-check-table" role="presentation">
111+
<table class="widefat striped health-check-table">
112112
<tbody>
113113
<?php
114114

@@ -126,9 +126,9 @@
126126
}
127127

128128
if ( in_array( $field_name, $sizes_fields, true ) ) {
129-
printf( '<tr><td>%s</td><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
129+
printf( '<tr><th scope="row">%s</th><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
130130
} else {
131-
printf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );
131+
printf( '<tr><th scope="row">%s</th><td>%s</td></tr>', esc_html( $field['label'] ), $values );
132132
}
133133
}
134134

0 commit comments

Comments
 (0)