WAI-ARIA Flashcards

1
Q

What are two aria-live values?

A

aria-live=”polite”, the screen reader will announce the change within the element after the user finishes typing.

aria-live=”assertive”, the screen reader will announce the change immediately, which is good for important error warnings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

<p></p>

After an Ajax form submit:

<p>

You successfully submitted the form.

</p>

Is this a good use of aria - polite?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

<p></p>

After the time limit has passed:

<p>
Your time is up!
</p>

Is this a good use of aria-assertive?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When do you use aria-atomic?

A

Sometimes only part of a string changes and then only that part of the string is announced. Maybe that makes no sense at all.

If you add aria-atomic=”true”, the whole content is announced.

Example aria-atomic=”true”:

<p>
Total price: € 0.00
</p>

After the dynamic change of the price:

<p>
Total price: € 5.25
</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is true of elements with the role=”alert”?

A

Elements with the role=”alert” have an implicit aria-live value of assertive, and an implicit aria-atomic value of true.

For Example:

<div>
You have {number} seconds left!
</div>

is equivalent to

<div>
You have {number} seconds left!
</div>

  • https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role
  • https://www.w3.org/WAI/ARIA/apg/patterns/alert/examples/alert/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How will this button be announced by a screen reader?

<button aria-expanded=”false”>Menu</button>

A

That is announced as: Menu collapsed button.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How will this button be announced by a screen reader?
<button aria-expanded=”true”>Menu</button>

A

That is announced as: Menu expanded button.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which values can aria-live hold?

A. aria-live=”true” and aria-live=”false”
B. aria-live=”indirect”, aria live=”direct” and aria-live=”off”
C. aria-live=”polite”, aria-live=”assertive” and aria-live=”off”

A

C. aria-live=”polite”, aria-live=”assertive” and aria-live=”off”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Aria-atomic is used to set whether the screen reader should always announce a live region as a whole, even if only part of the region changes.


A. True
B. False

A

A. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The role=”alert” has an implicit value of..?

A. aria-live=”polite”, aria-atomic=”true”
B. aria-live=”assertive”, aria-atomic=”true”

A

B. aria-live=”assertive”, aria-atomic=”true”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The role=”alert” can be added to every element in the DOM even if that means the role of the element will change.

A. True
B. False

A

B. False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If the dynamic change contains a lot of information, how should you handle this with aria-live?

A. Read all information that has been changed
B. Announce there has been a change and where the changed information can be found on the page

A

B. Announce there has been a change and where the changed information can be found on the page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

aria-expanded should be placed on:

A. The element that expands, for example the nav of a menu
B. The button that is used to toggle the expansion



A

B. The button that is used to toggle the expansion



How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

aria-expanded=”false” on a button with the accessible name “Menu” will be announced in VoiceOver as:

A. “Menu collapsed button”
B. “Menu closed button”


A

A. “Menu collapsed button”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the five rules of ARIA:

A

Rule 1: Don’t Use ARIA!
If you can use a native HTML element [HTML51] or attribute with the semantics and behavior you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so.

Rule 2: Do not change native semantics, unless you really have to.

Rule 3: All interactive ARIA controls must be usable with the keyboard.

Rule 4: Do not use role=”presentation” or aria-hidden=”true” on a focusable element. Using either of these on a focusable element will result in some users focusing on ‘nothing’.

Rule 5: All interactive elements must have an accessible name.
An interactive element only has an accessible name when its Accessibility API accessible name (or equivalent) property has a value.

https://www.w3.org/TR/using-aria/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which ARIA roles have a native HTML5 equivalent? Check all that apply:

A. role=”main”
B. role=”switch”
C. role=”form”
D. role=”tab”

A

A. role=”main”
C. role=”form”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is correct code to perform a JavaScript action?

A. <a>Calculate total</a>
B. <a>Calculate total</a>
C. <a>Calculate total</a>
D. <button>Calculate total</button>

A

D. <button>Calculate total</button>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the best aria-label on a button to close a login modal with an X close icon?

A. <button>X</button>
B. <button>X</button>
C. <button>X</button>
D. <button>X</button>

A

C. <button>X</button>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the difference between a property and a state?

A. They are the same.
B. A property has a permanent value, a state can change through user interaction.
C. A property is another word for attribute, a state is the value of the attribute.

A

B. A property has a permanent value, a state can change through user interaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How will a screen reader announce the following code on change of the seconds?

<span aria-live=”assertive” aria-atomic=”true”>You have 20 seconds left to complete this form.</span>

A. Immediately: “You have 20 seconds left to complete this form.”.
B. Immediately: “20”.
C. When the user stops interacting with the browser: “You have 20 seconds left to complete this form.”.
D. When the user stops interacting with the browser: “20”.

A

A. Immediately: “You have 20 seconds left to complete this form.”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The support of ARIA depends on:

A. The browser vendor and its version.
B. The assistive technology and its version.
C. The combination of browser vendor version and assistive technology version.

A

C. The combination of browser vendor version and assistive technology version.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the second rule of ARIA?

A. Don’t change native HTML semantics unless you really have to.
B. Only use Comic Sans as the default font for web content.
C. All interactive ARIA controls must be usable with the keyboard.

A

A. Don’t change native HTML semantics unless you really have to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How can you view the accessibility tree?

A. You need a special browser add-on to view the accessibility tree.
B. In the browser’s inspector.
C. The accessibility tree is only accessible to assistive technology and can not be viewed by a developer.

A

B. In the browser’s inspector.

24
Q

What are the six roles of ARIA?

A
  1. Document structure roles: these roles are used to provide a structural description for a section of content.
  2. Widget roles: the various widget roles are used to define common interactive patterns.
  3. Landmark roles: landmark roles provide a way to identify the organisation and structure of a web page. Screen reader users can navigate by landmarks. All landmarks are native HTML5, except <form role="search">. We will address that later.
  4. Live region roles: live Region roles are used to define elements with content that will be dynamically changed.
  5. Window roles: window roles define sub-windows to the main document window, within the same window, such as pop-up modal dialogs.

6 Abstract roles: abstract roles are only intended for use by browsers to help organise and streamline a document.

25
Q

these roles are used to provide a structural description for a section of content.

A

Document structure roles

26
Q

the various widget roles are used to define common interactive patterns.

A

Widget roles

27
Q

landmark roles provide a way to identify the organisation and structure of a web page. Screen reader users can navigate by landmarks. All landmarks are native HTML5, except <form role="search">

A

Landmark roles

28
Q

live Region roles are used to define elements with content that will be dynamically changed.

A

Live region roles

29
Q

define sub-windows to the main document window, within the same window, such as pop-up modal dialogs.

A

Window roles:

30
Q

only intended for use by browsers to help organise and streamline a document.

A

Abstract roles

31
Q

Is <main> a landmark role or a document structure role?

A. A document structure role.
B. A landmark role.
C. Both.
D. None of those.

A

B. A landmark role.

32
Q

Which attributes are redundant in: (check all that apply)
<button type=”button” role=”button” tabindex=”0″>Filter</button>

A. type=”button”
B. role=”button”
C. tabindex=”0”

A

B. role=”button”
C. tabindex=”0”

33
Q

Which use of the role attribute is correct? Check all that apply.

A. <button>text</button>
B. <form role="search">
C. <button>
D. <h2 role="tab"></button>

A

B. <form role="search">
C. <button></button>

34
Q

Is it a WCAG violation to put page content outside landmarks?

A. Yes.
B. No.

35
Q

What is true about role=”presentation”? Check all that apply.

A. It will hide the content from a screen reader.
B. Its synonym is role=”none”.
C. It removes all semantics from an HTML element.
D. With role=”presentation” we can use tables for layout in new code.

A

B. Its synonym is role=”none”.
C. It removes all semantics from an HTML element.

36
Q

What are the different values that aria-current can hold?

A

The property aria-current can hold different values. The accepted values are: page, step, location, date, time, true, and false.

  • https://a11y-collective.github.io/demos/en/aria/aria-current/index.html
  • https://www.a11y-collective.com/courses/aria-explained/lessons/properties-states-and-values/topics/aria-current/
37
Q

HTML5 validation from the browser: (check all that apply)

A. Can be disabled by using the attribute “novalidate” in the form element.
B. Is not accessible enough at the moment.
C. Is better than custom error messages.

A

A. Can be disabled by using the attribute “novalidate” in the form element.
B. Is not accessible enough at the moment.

38
Q

Which values can aria-current hold

A. Page, step, location, date, time, true and false.
B. True and false.
C. Active, page, step, location, date, time, true and false.

A

A. Page, step, location, date, time, true and false.

39
Q

You can use CSS to style elements with ARIA attributes. How would you style an active element (for example):

A. [aria-current] {font-weight: 700;}
B. [aria-current]:not([aria-current=”false”]) {font-weight: 700;}
C. [aria-current]:not([aria-current=”false”]) {color: #ff0000;}

A

B. [aria-current]:not([aria-current=”false”]) {font-weight: 700;}

40
Q

The attribute aria-expanded has to be added to:

A. The element that triggers the open/close action, e.g. a button.
B. The item that opens or closes, like the menu or a dialog.

A

A. The element that triggers the open/close action, e.g. a button.

41
Q

What is the difference between aria-label, aria-labellledby, and aria-describedby?

A
  • aria-label gives an element an accessible name
  • aria-labelledby gives a connected element an accessible name and is connected to that element with an id
  • aria-describedby adds extra information to an element and is connected to that element with an id.

https://www.a11y-collective.com/courses/aria-explained/lessons/accessible-names/

42
Q

What is the difference between a caption and a summary for a table?

A

The caption is the name of the table. A summary gives information about the organisation of the data in a table and helps users navigate through it.

43
Q

What can be improved in the link text of:
<a href=”https://en.wikipedia.org/wiki/Cat”>Read more</a>

A. The text “Read more” must be clearer, something like “If you want to read more, click this link”.

B. The link needs to be more descriptive, so screen reader users know where the link leads to, like: “Read more about cats”.

C. Nothing: It’s ok as it is.

A

B. The link needs to be more descriptive, so screen reader users know where the link leads to, like: “Read more about cats”.

44
Q

What is the accessible name of this link:
<a href=”https://wikipedia.org” class=”link-image”><img src=”wikipedia-logo.jpg” alt=”Logo Wikipedia”>Wikipedia</a>

A. wikipedia.org
b. Wikipedia
c. Logo Wikipedia Wikipedia

A

c. Logo Wikipedia Wikipedia

45
Q

What is the accessible name of this link:
<a href=”https://wikipedia.org” class=”link-image” aria-label=”Wikipedia”> <img src=”wikipedia-logo.jpg” alt=”Wikipedia logo”>Wikipedia</a>

A. wikipedia.org
B. Wikipedia
C. Logo Wikipedia Wikipedia

A

B. Wikipedia

46
Q

What is the accessible name of this link:
<a href=”https://joinmastodon.org/” class=”link-image”>
<svg
aria-hidden=”true”
viewBox=”0 0 24 24″
xmlns=”http://www.w3.org/2000/svg“
>[…]</svg>
Mastodon
</a>

A. joinmastodon.org
B. the link has no accessible name
c. Mastodon

A

c. Mastodon

47
Q

Which attribute adds extra text information to an input field in a form?

A. aria-label
B. aria-labelledby
C. aria-describedby

A

C. aria-describedby

48
Q

What is true about a table caption and a table summary? (check all that apply)

A. The caption gives the table its accessible name, the summary informs about how the table is structured.
B. A caption is a short summary.
C. The caption can be hidden by display: none;.
D. The caption is usually visible, the summary not.

A

A. The caption gives the table its accessible name, the summary informs about how the table is structured.
D. The caption is usually visible, the summary not.

49
Q

What is a good title attribute for a video iframe?

A. Youtube video
B. press play to start the video
C. YouTube short about cooking eggs by The Magic Chef

A

C. YouTube short about cooking eggs by The Magic Chef

50
Q

identifies an element (or elements) in order to define a visual, functional, or contextual relationship between a parent and its child elements when the DOM hierarchy cannot be used to represent the relationship.

51
Q

identifies an element as an input that controls another element, like a listbox or grid, that can dynamically pop up to help the user set the value of that input.

A

role=”combobox”

52
Q

the option role is used for selectable items in a listbox.

A

role=”option”

53
Q

What is one of the requirements for an accessible form?

A. Only aria-required can be used to indicate a field is required.
B. Error and success messages need to be announced by a screen reader.
C. The password requirements should never be announced.

A

B. Error and success messages need to be announced by a screen reader.

54
Q

What is a requirement for an autocomplete in a search form?

A. Screen reader users must be informed about the fact that there are suggestions.
B. The suggestions must be announced.
C. The selected value must be announced.
D. A screen reader (and keyboard) user must be able to reach the suggestions.
E. All of the above.

A

E. All of the above.

55
Q

Is an accessible Drag and Drop possible?

A. No, maybe in the future when assistive technology gets smarter.
B. Yes, but it takes careful coding and extended testing.

A

B. Yes, but it takes careful coding and extended testing.