WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: what does a default value for aria-level mean if it's required?


From: Birkir R. Gunnarsson
Date: Jan 20, 2020 7:49PM

Well, aria-level is a required attribute for role="heading".
But, as so often happens, if authors specify role=Heading" without a
value, the browsers/assistive technologies are left with the choice of
not exposing it at all or exposing it as a heading of some level.
The decision was made that, rather than ignoring it altogether (which
from the semantic point of view is the right thing to do, but not so
much from the assistive technology user point of view), that it should
be exposed as an h2 heading.
There is no browser default for "heading of undetermined level" so a
default level had to be specified, and 2 was the most likely
So this is a case where browsers/AT tries to make up for missing
author specification for the sake of the user.
You see this elsewhere, e.g. when Jaws reads the file name for the
image file (without the path) for image elements with no alt
attributes, though that is the decision of a specific screen reader
manufacturer rather than something recommended by the W3C (Voiceover
on iOS, for instance, ignores static images without alt attribute).
So, in a sense you are right that it is confusing that, when a
required attribute is missing that the element is still exposed to
users with a default value, and this is rather the exception than the

On 1/20/20, glen walker < <EMAIL REMOVED> > wrote:
> The spec for role="heading" (https://www.w3.org/TR/wai-aria/#heading) says:
> *Required States and Properties: *aria-level
> *Implicit Value for Role: *Default for aria-level is 2.
> Is aria-level really required? The Nu Html Checker (
> https://validator.w3.org/nu/) does not complain if I don't have an
> aria-level.
> <div role="heading">
> If aria-level **is* *required for role="heading", how can you have a
> default value? The validator complains if I have an empty value
> <div role="heading" aria-level>
> I'm not following how an implicit value of 2 is used for aria-level if
> aria-level is required and needs a value.
> > > > >

Work hard. Have fun. Make history.