Page MenuHomePhabricator

Update Navbox template markup to improve accessibility
Closed, DeclinedPublic

Description

Background

The Navbox template has some accessibility issues that should be solvable by improving the markup and semantics. Currently, the 'show' and 'hide' buttons are not marked up as actual buttons, and rely on <span> element with role=button and <a> elements without hrefs. Navboxes also over use role='navigation', greatly increasing the number of navigation landmarks on a given page, which introduces noise for screenreader users trying to navigate via landmarks. This is exacerbated by the fact that navboxes can have nested navboxes. A

TODO

  • 'show' and 'hide' buttons use a <button>
  • Avoid using role='navigation' on every Navbox template, instead wrap all navbox templates with a single <nav>.

Event Timeline

@bwang: Which "Navbox template" in which code repository or on which website is this task about and/or in which team's scope is this task?

Assuming this is about {{navbox}}:

Show and hide 'buttons' are set by mw-collapsible and this is something that could/should be adjusted in MediaWiki. I'd personally advise opening a separate task, or possibly latching on to T333357: Please add role=button in Collapsible Elements to a.mw-collapsible-text where I noted it should probably just be its own <button>, since this impacts more than just {{navbox}}.

Avoid using role='navigation' on every Navbox template, instead wrap all navbox templates with a single <nav>.

This is not quite impossible today due to template expansion limits. It's also not likely you'll get consensus for since it would require affecting every page with navboxes in their wikitext and in non-trivial ways. I do not put that in the realm of doable. (It might be enhanced by adjustments like T124168#3997564, but that similarly affects many many pages.)

It is actually impossible because wiki text does not have access to <nav> though I have argued for it (and need to get back to the related discussion at some point). See T25932#7070297 and later. Of course, point is still salient in the case of role=navigation.

@Izno Thanks for the response, in light of the things you brought up I will just close this task, as its already covered by T333357 or is not possible. Regarding the role=navigation I'm almost inclined to say that removing the role altogether from this template would be better than the status quo, but considering this is used in so many pages and is such a large change its probably not worth exploring.