W3C home > Mailing lists > Public > www-validator@w3.org > July 2014

Implied ARIA Roles

From: Craig Francis <craig@craigfrancis.co.uk>
Date: Tue, 22 Jul 2014 13:50:05 +0100
Message-Id: <2F615E00-3FD7-4D67-AFFB-FA011370F28F@craigfrancis.co.uk>
To: www-validator@w3.org
Hi,

When validating a document with an @aria-sort attribute, the validator requires that a @role should also be specified.

As I'm adding this on a <th scope="col">, isn't this already implied by the markup?

http://www.w3.org/TR/wai-aria/roles#columnheader

Base Concept:	HTML th[scope="col"]

An example HTML table is below, where I realise the <span> isn't necessarily the best approach (trying to avoid an <img> which will add additional HTTP requests)... where I am hoping that in time the @aria-sort attribute will be supported by UA's and will provide a much better interface.

I've also brought this issue up on SO:

http://stackoverflow.com/questions/24863531/using-aria-sort-in-validated-html5

Craig




<!DOCTYPE html>
<html lang="en-GB">
<head>
  <meta charset="UTF-8" />
  <title>ARIA Sort</title>
</head>
<body>

  <table>
    <thead>
      <tr>
        <th scope="col" aria-sort="none"><a href="#">Name&#xA0;<span title="Sort">&#9650;</span></a></th>
        <th scope="col" aria-sort="ascending"><a href="#">Score&#xA0;<span title="Ascending">&#9650;</span></a></th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">A</th>
        <td>1</td>
      </tr>
    </tbody>
  </table>

  <table role="grid">
    <thead>
      <tr role="row">
        <th scope="col" role="columnheader" aria-sort="none"><a href="#">Name&#xA0;<span title="Sort">&#9650;</span></a></th>
        <th scope="col" role="columnheader" aria-sort="ascending"><a href="#">Score&#xA0;<span title="Ascending">&#9650;</span></a></th>
      </tr>
    </thead>
    <tbody>
      <tr role="row">
        <th scope="row" role="rowheader">A</th>
        <td role="gridcell">1</td>
      </tr>
    </tbody>
  </table>

</body>
Received on Tuesday, 22 July 2014 21:16:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:11 UTC