[whatwg] Validator.nu: "Attribute role not allowed on element h2 at this point."

Benjamin Hawkes-Lewis bhawkeslewis at googlemail.com
Tue Mar 13 09:30:20 PDT 2012

2012/3/13 Scott González <scott.gonzalez at gmail.com>:
> It's my understanding that authors should only apply ARIA via script.

No. Where do you understand that from?

> The
> redundancy cases seem to be the most reasonable use cases I've heard of for
> wanting ARIA in the initial markup, but even that seems wrong. What happens
> when you have type=range and role=slider, the UA doesn't understand the new
> types, and the script either never loads or has an error? The AT will pick
> up the role, but none of the functionality will be there. I don't see how
> that's better than not having the role applied.

First, there are ARIA annotations that do not depend on JS but do
overlap with native semantics, e.g.:


<div role="navigation">

<nav role="navigation">

Second, plenty of authors do produce HTML that do not work without JS.
This isn't good practice, but there's little reason to discourage use
of ARIA markup _especially_ in those cases, where we do not discourage
other JS-dependent initial markup like (say):

<button type="button"> (without an associated form)


<a href="javascript: ...">


Benjamin Hawkes-Lewis

More information about the whatwg mailing list