ACCESSIBILITY - DEVELOPERS FAQ
******************************
I SCREENREADERS
1. The desktop SR I am using for testing will not focus all of the
content on the page when I navigate the page from top to bottom. Why?
There are two common reasons for this.
Incorrect SR use:
Are you using the SRreen reader correctly? Both NVDA(Windows) and
VoiceOver (macOS) can be used to either jump from one interactive
element to another (similar to visual keyboard navigation with the
tabulator key), or to navigate the page in the DOM order element by
element, exposing all of the page content including passive text and
images.
For the latter use mode, which should be employed in testing, you MUST
NOT use the tabulator (TAB) key. Instead, you must command the SR to
advance element by element. On NVDA, you do this with the up/down arrow
keys. On VO, you use VO+Right/Left arrow keys by default.
NOTE: If the SR is in the Forms aka input mode (NVDA), or has delved
inside a container (VO), you have to first return to the normal
navigation mode before you can proceed along the page. To do this, on
NVDA press ESR or NVDA+Space; on VO, press Shift+VO+Up Arrow or Shift +
VO + Down Arrow to aSRend and deSRend (step by step) to/from a
container.
Aria-hidden:
There may be content on your page that has been specifically hidden from
assistive technology. Look for elements with aria-hidden=true
attributes. If the content should be exposed to assistive technology,
remove the aria-hidden attribute.
II WORKING WITH CONTENT
1. Where do I place the aria-expanded attribute on a menu, accordion,
pop-up, etc?
Place the attribute on the element that triggers something to open and
close. Do not place it inside the content being opened.
That is, use:
NOT:
Also, remember that you must update the attribute value in code whenever
the content opens or closes. It will not auto update in response to
changes to the DOM. It is only a passive descriptor.
2. How do I hide content from assistive technology without hiding it
visually or removing it from the page?
Use the aria-hidden=true attribute. The DOM tree inside the element,
and the element itself, will be made non-existing and inaccessible to
screenreaders.
Note: You cannot make an element unfocusable to keyboard users
(navigating the web page with the tabulator key) by using aria-hidden.
The attribute only affects assistive technology, and keyboard
navigation is not a form of assistive technology.
3. How do I make an element focusable or unfocusable for keyboard users?
Use the tabindex attribute. Tabindex=0 will mark the element as part
of the page tab order. It can then be tabbed into with a keyboard.
Tabindex-1, in turn, will make the element unfocusable for keyboard
users.
Tabindex=-1 elements can still be programmatically focused (e.g. by
Javascript HTMLElement.focus() method). They can also be focused by
screen readers.
To make content only available to pointer device users (mouse, touch),
use both tabindex=-1 and aria-hidden=true together.
4. What is the difference between ALT="" and aria-hidden=true?
The ALT attribute is used on tags. When the attribute has an empty
string or has no value, assistive technology hides the image as if it
did not exist on the page.
Aria-hidden, unlike ALT, can be used with any tag. An tag can, of
course, contain both attributes. In some situations, this can be
useful. For example, an image can be hidden from screen readers without
having to give it an empty ALT text.
Visit our sponsor SomeCompany
Here, the image alt is shown to visual users in case the image fails to
load (pointing at an external resource, perhaps), but screen reader
users will not perceive the image due to its aria-hidden status. This
is done because the logo image has no informative purpose and is aimed
only at visual users. Removing unnecessary parts makes the link easier
to comprehend for a screen reader user.
One could also write:
Visit our sponsor: SomeCompany
This, too, hides the image from screen readers, but will not display ALT
for text-only browser users or when the image fails to load. That is,
the image is treated as decorative.
Both methods are sound. The choice between the two is a service design
decision.
5. I use the