Skip to content

Commit 7520c31

Browse files
authored
Create selectedcontent.html
adds test case for selectedcontent element and button part within customizable select
1 parent 0e19fad commit 7520c31

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

tests/selectedcontent.html

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!DOCTYPE html>
2+
<html lang="en"><head>
3+
<meta charset="UTF-8">
4+
<title>ARIA in HTML - Test Cases</title>
5+
<link rel="stylesheet" href="../results/styles.css">
6+
<style>
7+
body{
8+
font-size: 1em;
9+
}
10+
.roleTest {
11+
border: 2px solid black;
12+
width: 1em;
13+
height: 1em;
14+
margin: 5px;
15+
}
16+
.flex {
17+
display: flex;
18+
flex-wrap: wrap;
19+
align-items: stretch;
20+
}
21+
.widgetDemo {
22+
border: 1px solid #EEE;
23+
margin: .5em;
24+
padding: 5px;
25+
flex: 1 0 0;
26+
min-width: calc(300px - 1em);
27+
}
28+
.widgetDemo p {
29+
color: #696969;
30+
font-size: 1.125em;
31+
padding: 0;
32+
margin: .75em 0;
33+
}
34+
.testcase {
35+
margin: 2em 0;
36+
}
37+
h3{
38+
margin: .5em 0;
39+
border: 0;
40+
padding: 0;
41+
}
42+
h2 {font-size:2em}
43+
</style>
44+
<style>
45+
select, ::picker(select) {
46+
appearance: base-select;
47+
}
48+
</style>
49+
</head>
50+
<body>
51+
52+
<header>
53+
<h1>ARIA in HTML - test cases for <code>selectedcontent</code> and <code>select</code>'s <code>button</code> part elements</h1>
54+
<p>last updated 23 July 2025</p>
55+
</header>
56+
<main>
57+
<h2>Tests:</h2>
58+
59+
<div class="flex">
60+
<div class="widgetDemo">
61+
<h3>Test 1</h3>
62+
<p>
63+
Authors MUST NOT use any <code>role</code> or <code>aria-*</code> attribute on the <code>selectedcontent</code> attribute when it
64+
is a valid child of the <code>button</code> part of a customized <code>select</code> element. Additionally authors MUST NOT use ARIA
65+
attributes on the <code>button</code> part of a customized <code>select</code> element.</p>
66+
67+
<div class="testcase">
68+
<label for=s>Test 1</label>
69+
<select id=s>
70+
<button aria-label=bar aria-expanded=false><selectedcontent role=link aria-label=foo></selectedcontent></button>
71+
<option>option 1</option>
72+
<option>option 2</option>
73+
</select>
74+
</div>
75+
76+
<p><strong>Expected result:</strong>
77+
<br> error or warn for inappropriate use of the <code>role</code> and any <code>aria-*</code> attribute when element is a
78+
child of the button part of a customized <code>select</code> element. </p>
79+
</div>
80+
81+
<div class="widgetDemo">
82+
<h3>Test 2</h3>
83+
<p>
84+
The use of the <code>selectedcontent</code> element outside of the context of the button part of a customizable <code>select</code>
85+
element is invalid. But, to allow for a11y remediation of author misuse, ARIA attributes MAY be used on the element in this context.</p>
86+
<div class="testcase">
87+
<selectedcontent style="color: blue; text-decoration: underline;" role=link aria-label=foo tabindex=0>xxx</selectedcontent>
88+
</div>
89+
90+
<p><strong>Expected result:</strong>
91+
<br> while the use of the <code>seletedcontent</code> element is incorrectly used in this example, the use of ARIA is allowed
92+
so authors may correct for misuse of the element, thus no errors related to the use of ARIA attributes should be flagged in this case.</p>
93+
</div>
94+
</div>
95+
</main>
96+
</body>
97+
</html>

0 commit comments

Comments
 (0)