-
-
Notifications
You must be signed in to change notification settings - Fork 714
Description
Seems like a landmark label/name defined as aria-labelledby
will be announced or ignored inconsistently based on:
- Position of the element referred by
aria-labelledby
(inside or outside of a landmark) - Interactive content in the landmark reached by
TAB
key when entering it (e.g. in my case the different behavior for links inside of lists and tablists)
Steps to reproduce:
- Use NVDA in combination with IE 11, FF or Chrome (my setup specified below)
- Open https://codepen.io/Hrvoje-Go/pen/eYJrZEY
- Navigate the page ONLY by using the
TAB
key - Notice how the landmark label/name is announced or ignored inconsistently. The landmark role itself (main, navigation, region) is always announced, but not the label/name
Actual behavior:
- FAIL: Landmark label/name is ignored if defined as
aria-labelledby
that refers to an element contained inside of the landmark HTML element- The example code uses
<nav>
and<section>
elements to define a landmark - The example code uses
<h3>
element as a reference foraria-labelledby
, but it's the same case is with<span>
and/or random visible or visually hidden HTML element
- The example code uses
- OK: Landmark label is announced if implemented as
aria-labelledby
that refers to an element outside of the landmark - STRANGE: If the inner element is a link with a role
tab
in atablist
then the landmark label is announced regardless if the referred element is inside or outside of the landmark - OK: Landmark label is announced always when
aria-label
is used instead ofaria-labelledby
Real use-case (detailed information)
Our actual product implementation includes a header with 4 navigation menus each containing it's own visually hidden heading (for better outline, and for users who navigate by headings) e.g. "Quick access" nav, "Main" nav, sub nav, etc.. One of those menus is implemented as a tablist and others as a list of links. When navigating with a TAB
key the tablist navigation menu does announce its landmark label/name and the other 3 menus do not. There would only announce the role "navigation landmark" without a label to distinguish from. That was confusing and also how we recognized the issue in the first place.
I assume that NVDA wanted to ignore the landmark label if contained within the landmark HTML element itself. Probably to avoid duplicate announcement when navigating in virtual mode. There are a few points, in my opinion, where this might not be the best idea:
- Not analog to
aria-label
behavior which is always announced. One would logically assume thataria-labelledby
could easily replacearia-label
retaining the same behavior - always announcing the label regardless of the position of the referenced element - Not intuitive. Unexpected behavior. One would not expect that the landmark labeling will not work or stop working if the referenced element position has changed (e.g. from inside to the outside). Can be broken easily during the development or maintenance (e.g. by developers/designers who focus on a different problem). Who could constantly keep track of the position of the referenced element and follow up how will this impact the screen reader?
- Inconsistent. As recognized in our navigation menus example where lists of links and tablists are used sequentially but the behavior is different although it's the exact same implementation of the container element - navigation landmark (nav + aria + h3)
- If a user uses only the
TAB
key to navigate the menus, which is not so difficult to imagine, then both landmark label and actual heading announcement is skipped. In this case the trial of NVDA to avoid duplicate announcement led to not announcing anything at all (?) - Might be controversial but there are a few good points that NVDA would not be doing anything wrong if the announcement would be duplicated. First time for the landmark and second time for the heading. It's two different things nad it's kind of expected if that's how it was developed. See Draft guidance to help authors understand the difference between landmark regions and outline sections w3c/aria-practices#575 (comment)
- JAWS imho behaves correctly here as one would expect, not trying to assume anything and outsmart the implementation. In this specific case maybe NVDA might not be doing better
Expected behavior:
- Landmark label/name should be always announced aside to a landmark role when defined as
aria-labelledby
. It must be regardless if the referred element is outside or contained inside of the landmark HTML element as a child. Also regardless if navigating byTAB
key caused entering the landmark region first onto a link in a list of links or a tab in a tablist. The behavior should be analog to the announcement whenaria-label
is used - The label should be always consistently announced!
System configuration
NVDA installed/portable/running from source:
installed
NVDA version:
2020.1
Windows version:
Windows 8.1
Name and version of other software in use when reproducing the issue:
- Chrome 80.0.3987.122
- Edge 83.0.478.61
- Firefox 77.0.1
- IE 11.0.9600.19724 (version update 11.0.195)
Other information about your system:
Other questions
Does the issue still occur after restarting your computer?
Yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
No
If addons are disabled, is your problem still occuring?
- No NVDA addons.
- No browser extensions (clean installation)
Did you try to run the COM registry fixing tool in NVDA menu / tools?
Yes