Loading core/modules/node/tests/src/Functional/NodeAdminTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,8 @@ public function testContentAdminSort() { ':label' => $string, ])); } // Verify aria-sort is present and its value matches the sort order. $this->assertSession()->elementAttributeContains('css', 'table thead tr th.views-field-title', 'aria-sort', 'ascending'); } /** Loading core/modules/views/views.theme.inc +7 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,13 @@ function template_preprocess_views_view_table(&$variables) { // Improves accessibility of complex tables. $variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column'); } // aria-sort is a WAI-ARIA property that indicates if items in a table // or grid are sorted in ascending or descending order. See // http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort if ($active == $field) { $variables['header'][$field]['attributes']['aria-sort'] = ($order == 'asc') ? 'ascending' : 'descending'; } // Check if header label is not empty. if (!empty($variables['header'][$field]['content'])) { $has_header_labels = TRUE; Loading Loading
core/modules/node/tests/src/Functional/NodeAdminTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,8 @@ public function testContentAdminSort() { ':label' => $string, ])); } // Verify aria-sort is present and its value matches the sort order. $this->assertSession()->elementAttributeContains('css', 'table thead tr th.views-field-title', 'aria-sort', 'ascending'); } /** Loading
core/modules/views/views.theme.inc +7 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,13 @@ function template_preprocess_views_view_table(&$variables) { // Improves accessibility of complex tables. $variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column'); } // aria-sort is a WAI-ARIA property that indicates if items in a table // or grid are sorted in ascending or descending order. See // http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort if ($active == $field) { $variables['header'][$field]['attributes']['aria-sort'] = ($order == 'asc') ? 'ascending' : 'descending'; } // Check if header label is not empty. if (!empty($variables['header'][$field]['content'])) { $has_header_labels = TRUE; Loading