-
Notifications
You must be signed in to change notification settings - Fork 0
/
listbox.html
91 lines (91 loc) · 5.42 KB
/
listbox.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Listbox</title>
<script src="js/frontend-es5.js"></script>
<link rel="stylesheet" href="css/frontend.css" />
</head>
<body>
<h1>Listbox</h1>
<p>This is a Cypress test page. For specifications, please see the <a href="/mochawesome-report/mochawesome.html">Cypress test report</a>.</p>
<fieldset id="test-0">
<legend>Native select</legend>
<label for="select">Native select</label>
<select id="select">
<option value="">Default</option>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
<option value="option4">Option 4</option>
<option value="option5">Option 5</option>
</select>
</fieldset>
<fieldset id="test-1">
<legend>Single-select listbox A</legend>
<p>Each option is a DOM descendant of the listbox. No default selection. Collapsible.</p>
<p class="label" data-for="listbox-a-button" id="listbox-a-label">Listbox A</p>
<div class="select" data-selection-follows-focus="false" data-cy-default-selection="false">
<button id="listbox-a-button" aria-haspopup="listbox">Default</button>
<div id="listbox-a" role="listbox" aria-labelledby="listbox-a-label" tabindex="0" hidden>
<div role="option" tabindex="-1">Default</div>
<div role="option" tabindex="-1">Option A1</div>
<div role="option" tabindex="-1">Option A2</div>
<div role="option" tabindex="-1">Option A3</div>
<div role="option" tabindex="-1">Option A4</div>
<div role="option" tabindex="-1">Option A5</div>
</div>
</div>
</fieldset>
<fieldset id="test-2">
<legend>Single-select listbox B</legend>
<p>Each option is a DOM descendant of the listbox. Default selection. Collapsible.</p>
<p class="label" data-for="listbox-b-button" id="listbox-b-label">Listbox B</p>
<div class="select" data-selection-follows-focus="false" data-cy-default-selection="true">
<button id="listbox-b-button" aria-haspopup="listbox">Default</button>
<div id="listbox-b" role="listbox" aria-labelledby="listbox-b-label" tabindex="0" hidden>
<div role="option" aria-selected="true" tabindex="-1">Default</div>
<div role="option" tabindex="-1">Option B1</div>
<div role="option" tabindex="-1">Option B2</div>
<div role="option" tabindex="-1">Option B3</div>
<div role="option" tabindex="-1">Option B4</div>
<div role="option" tabindex="-1">Option B5</div>
</div>
</div>
</fieldset>
<fieldset id="test-3">
<legend>Single-select listbox C</legend>
<p>Each option is not a DOM descendant of the listbox, so <code>aria-owns</code> exposes the parent/child contextual relationship. Default selection. Collapsible.</p>
<p class="label" data-for="listbox-c-button" id="listbox-c-label">Listbox C</p>
<div class="select" data-selection-follows-focus="false" data-cy-default-selection="true">
<button id="listbox-c-button" aria-haspopup="listbox">Default</button>
<div id="listbox-c" role="listbox" aria-labelledby="listbox-c-label" aria-owns="option-c0 option-c1 option-c2 option-c3 option-c4 option-c5" tabindex="0" hidden>
<div>
<div role="option" id="option-c0" aria-selected="true" tabindex="-1">Default</div>
<div role="option" id="option-c1" tabindex="-1">Option C1</div>
<div role="option" id="option-c2" tabindex="-1">Option C2</div>
<div role="option" id="option-c3" tabindex="-1">Option C3</div>
<div role="option" id="option-c4" tabindex="-1">Option C4</div>
<div role="option" id="option-c5" tabindex="-1">Option C5</div>
</div>
</div>
</div>
</fieldset>
<fieldset id="test-4">
<legend>Multi-select listbox</legend>
<p>This should not be processed.</p>
<p class="label" data-for="listbox-d-button" id="listbox-d-label">Listbox D</p>
<div class="select" data-selection-follows-focus="false" data-cy-default-selection="true">
<button id="listbox-d-button" aria-haspopup="listbox">Default</button>
<div id="listbox-d" role="listbox" aria-labelledby="listbox-d-label" aria-multiselectable="true" tabindex="0" hidden>
<div role="option" aria-selected="true">Default</div>
<div role="option" aria-selected="false">Option D1</div>
<div role="option" aria-selected="false">Option D2</div>
<div role="option" aria-selected="false">Option D3</div>
<div role="option" aria-selected="false">Option D4</div>
<div role="option" aria-selected="false">Option D5</div>
</div>
</div>
</fieldset>
</body>
</html>