WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Nav landmarks query

for

Number of posts in this thread: 2 (In chronological order)

From: Murphy, Sean
Date: Tue, Apr 28 2020 12:25AM
Subject: Nav landmarks query
No previous message | Next message →

All,


Sorry about the prior post, I meant to reply to the prior thread on landmarks. Didn't read the subject line correctly.

I have just discovered a very interesting fact in relation to nav element. In an old Webaim article https://webaim.org/blog/future-web-accessibility-html5-semantic-tags/ : https://webaim.org/blog/future-web-accessibility-html5-semantic-tags/. The below text has been extracted from the article (note this is a 2012 article):

--- beginning of extract ----

There is significant overlap between the semantic meaning of many of the new HTML5 semantic elements and some of the document structure and landmark roles from WAI-ARIA. The HTML5 spec contains a section on ARIA dealing with how the different roles can be applied to HTML5 elements.

In some cases, HTML5 requires user agents to automatically use specific ARIA roles on certain elements, without the author having to specifically include them, and in fact even if the author explicitly says to use some other role. For example, the HTML5 <nav> element must always have the ARIA navigation role, with no exceptions. So <nav> (with no ARIA role specified), <nav role="navigation"> and <nav role="main"> will be all handled by web browsers and assistive technology as if they were each <nav role="navigation">.

-- end of extract ---

I have just tested this and the above statement is not true any more. Using the latest firefox and chrome with NVDA and Jaws. When I used <nav role="button"> the role changed to a button. The formal html5 specifications show the following:

' Contexts in which this element can be used: Where flow content is expected.
' Content model: Flow content, but with no main element descendants.
' Tag omission in text/html: Neither tag is omissible
' Content attributes: Global attributes
' Allowed ARIA role attribute values: navigation role (default - do not set).
' Allowed ARIA state and property attributes: Global aria-* attributes
Any aria-* attributes applicable to the default role.

The above specs don't indicate clearly if any other roles can be set. The absence of other ARIA roles, does this mean no other roles should be set? If my assumption is correct, does this mean the browsers are not correctly implementing the specs?

Sean

From: glen walker
Date: Tue, Apr 28 2020 8:26AM
Subject: Re: Nav landmarks query
← Previous message | No next message

> The above specs don't indicate clearly if any other roles can be set.

I suppose it depends how you read the spec. The section in the spec for
roles is labeled "Allowed ARIA role attribute values". If the role isn't
listed, it's not allowed. Personally, I think that's clear.

As far as what actually happens when you go against the spec is potentially
random.

<nav role="button"> is flagged by the html parser as an error,
https://validator.w3.org/nu