Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed roles for nav element does not include none or presentation roles #344

Closed
jongund opened this issue Aug 27, 2021 · 11 comments · Fixed by #404
Closed

Allowed roles for nav element does not include none or presentation roles #344

jongund opened this issue Aug 27, 2021 · 11 comments · Fixed by #404
Assignees
Labels
Allowed roles Pertaining to the allowed roles of HTML elements

Comments

@jongund
Copy link

jongund commented Aug 27, 2021

I am curious to the reasoning of allowing none and presentation roles on the aside element, but not allowing them on the nav element. There is a lot of abuse of the nav element and this restriction takes away one technique to remediate those pages. It also appears to me to be a little inconsistent when another similar element, aside is allowed to have role none or presentation.

I think nav should be allowed the roles none or presentation, especially when you have nested nav elements.

@dylanb
Copy link

dylanb commented Aug 27, 2021

Why are we restricting it at all, isn't its purpose to allow semantics to be removed regardless? This seems as absurd as saying oh, you can not use aria-hidden on <img> but you can use it on other elements.

@scottaohara
Copy link
Member

@jongund i think you raise a good point. Being before my time here, I can assume as to why this rule was created. Likely due to the pretty straight forward meaning of nav vs the ambiguous nature of aside to developers and how its use in html vs its aria landmark usage can seem contradictory, as I know you are already aware. I.e., aside is more ripe to unwanted semantics than nav, regardless of misuse. That said, there is no reason this couldn’t use another review and update in the next version of the spec, as I tend to agree consistency here is important.

@dylanb there are definitely instances of where declaring role presentation/none would not be appropriate (as would declaring aria-hidden on certain elements, for that matter). For instance using it on a focusable element. And while I’m sure you know, this would then result in UAs having to error correct for author misuse. This of course, while not applicable for this particular issue that Jon raised, is not absurd to have restrictions if considering such situations.

@dylanb
Copy link

dylanb commented Aug 28, 2021

@dylanb there are definitely instances of where declaring role presentation/none would not be appropriate

I think the disconnect here is that @jongund is talking about using ARIA to make bad code better and @scottaohara is looking at this from the perspective of "good coding practices".

It is definitely better not to put role of none or presentation on a <nav> but if this is change is feasible (for example low effort) and it makes the accessibility better while refactoring the app to eliminate the use of the <nav> is not feasible (for example a very large amount of work), then the spec should not "disallow" that. It is a very valid use, even if it is not ideal.

@scottaohara

This comment was marked as off-topic.

@stevefaulkner
Copy link
Collaborator

I suggest that should not be better than should if we are going to change from must not. The spec should encourage best practice wherever practical

@dylanb

This comment was marked as off-topic.

@scottaohara

This comment was marked as off-topic.

@jongund
Copy link
Author

jongund commented Sep 8, 2021

I think the none and presentation role values should be allowed on the main and nav elements, this provides a path to "fix" poor markup, especially when nav element is nested with other nav elements. This will also make them consistent with the other elements that can create landmarks (e.g. aside, footer, form, header).

@scottaohara scottaohara added the Allowed roles Pertaining to the allowed roles of HTML elements label Sep 8, 2021
@scottaohara scottaohara added this to the ARIA in HTML: Next milestone Sep 20, 2021
@dylanb

This comment was marked as off-topic.

@scottaohara

This comment was marked as off-topic.

@dylanb

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Allowed roles Pertaining to the allowed roles of HTML elements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants