ARIA Flashcards
What does ARIA stand for?
“Accessible Rich Internet Applications”
The first rule of ARIA use?
If you can use a native HTML element or attribute with the semantics and behavior you require already built in, USE THAT instead of re-purposing an element and adding an ARIA role.
The second rule of ARIA use?
Do not change native semantics unless you really. have to (ex: do not do h2, do div/h2> to create a heading that is also a tab).
The third rule of ARIA use?
All interactive ARIA controls must be usable with the keyboard. (ex: if using role=button the element must be able to receive focus and user must be able to activate the action via keyboard)
The fourth rule of ARIA use?
Do not use role=”presentation” or aria-hidden=”true” on a focusable element. It may result in users being able to focus on ‘nothing’.
The fifth rule of ARIA use?
All interactive elements must have an accessible name.
What does adding a role do to the native semantics?
Adding ARIA roles overrides the native role semantics.
What does adding a role NOT do?
Adding an ARIA role will nto make an element look or act differently for people NOT using assistive technology. It will not change the behaviors, states and properties of the host element.
What happens when you use role=presentation / role=none
This role removes the semantics from the element that it is on. It becomes a node in the DOM tree with no semantic meaning.
What is the behavior of children inside tags that have role set to presentation or none?
Required elements will also have their semantics removed (like tr, td inside a table with role=none).
Non-requirement children nested inside the element keep their semantics.
T/F: This is the correct way to implement and label a background image: <div> <span class="background-image"> </span> [all the rest of my content] </div>
True- do not put a CSS background image inside a div that contains content- better to use an empty span and an aria-label with role=image.
T/F: This is the correct way to implement and label a background image:
<div>
[all the rest of my content]
</div>
False- do not put a CSS background image inside a div that contains content- better to use an empty span and an aria-label with role=image.
What’s wrong with the following tag?
Press Me
Setting the role is redundant since the element is already a button!