1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN"
2 "http://www.w3.org/TR/REC-html40/strict.dtd">
3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
4 <meta http-equiv=
"Content-Script-Type" content=
"application/ecmascript">
5 <title>ECMAScript accessKey tests
</title>
6 <h1>ECMAScript accessKey tests
</h1>
8 <h2>Set valid access keys and read them back
</h2>
10 <p>This does not automatically test that the assigned access keys
12 <form name=
"form1" action=
"#">
13 <p><input type=
"button" onclick=
"run1()" value=
"Test"> <input id=
"result1" value=
"not run">
16 <tr><td><input id=
"a1" accesskey=
"a"><td><td>empty string
17 <tr><td><input id=
"b1" accesskey=
"b"><td>U+
0020<td>must not become
"Space"
18 <tr><td><input id=
"c1" accesskey=
"c"><td>U+
0025<td>ASCII punctuation
19 <tr><td><input id=
"d1" accesskey=
"d"><td>U+
007A
<td>ASCII letter
20 <tr><td><input id=
"e1" accesskey=
"e"><td>U+
00E5
<td>Latin-
1
21 <tr><td><input id=
"f1" accesskey=
"f"><td>U+
0161<td>Latin-
9
22 <tr><td><input id=
"g1" accesskey=
"g"><td>U+
3042<td>Hiragana
23 <tr><td><input id=
"h1" accesskey=
"h"><td>U+
10A55
<td>Kharoshthi
26 <script type=
"application/ecmascript">
28 var form = window.document.forms[
"form1"];
29 form.elements[
"result1"].value =
"running";
31 var probe = function(element, accessKey) {
32 element.accessKey = accessKey;
33 if (element.accessKey != accessKey) {
35 element.value =
"failed " + accessKey +
"/" + element.accessKey;
37 element.value =
"passed " + accessKey +
"/" + element.accessKey;
40 probe(form.elements[
"a1"],
"");
41 probe(form.elements[
"b1"],
" ");
42 probe(form.elements[
"c1"],
"%");
43 probe(form.elements[
"d1"],
"z");
44 probe(form.elements[
"e1"],
"\u00E5");
45 probe(form.elements[
"f1"],
"\u0161");
46 probe(form.elements[
"g1"],
"\u3042");
47 probe(form.elements[
"h1"],
"\uD802\uDE55");
48 form.elements[
"result1"].value = ok ?
"passed" :
"failed";
53 <h2>These might throw errors
</h2>
54 <form name=
"form2" action=
"#">
56 <tr><td><input type=
"button" value=
"Test" onclick='run2(
"a2",-
273.15)'
><td><input id=
"a2"><td>number -
273.15
57 <tr><td><input type=
"button" value=
"Test" onclick='run2(
"b2",
"\u0000")'
><td><input id=
"b2"><td>U+
0000
58 <tr><td><input type=
"button" value=
"Test" onclick='run2(
"c2",
"\u0001")'
><td><input id=
"c2"><td>U+
0001
59 <tr><td><input type=
"button" value=
"Test" onclick='run2(
"d2",
"\u000A")'
><td><input id=
"d2"><td>U+
000A
60 <tr><td><input type=
"button" value=
"Test" onclick='run2(
"e2",
"hyi")'
><td><input id=
"e2"><td>"hyi"
61 <tr><td><input type=
"reset">
64 <script type=
"application/ecmascript">
65 function run2(name, accessKey) {
66 var form = window.document.forms[
"form2"];
67 var element = form.elements[name];
68 element.accessKey = accessKey;
69 if (element.accessKey != accessKey)
70 element.value =
"different " + accessKey +
"/" + element.accessKey;
72 element.value =
"same " + accessKey +
"/" + element.accessKey;
77 <h2>Invalid uses of surrogates
</h2>
78 <form name=
"form3" action=
"#">
80 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"a3",
"\uD800")'
><td><input id=
"a3"><td>U+D800
81 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"b3",
"\uD800.")'
><td><input id=
"b3"><td>U+D800 U+
002E
82 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"c3",
"\uD800\uD800")'
><td><input id=
"c3"><td>U+D800 U+D800
83 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"d3",
"\uD800\uDBFF")'
><td><input id=
"d3"><td>U+D800 U+DBFF
84 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"e3",
"\uD800\uE000")'
><td><input id=
"e3"><td>U+D800 U+E000
85 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"f3",
"\uDBFF\uDBFF")'
><td><input id=
"f3"><td>U+DBFF U+DBFF
86 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"g3",
"\uDC00")'
><td><input id=
"g3"><td>U+DC00
87 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"h3",
"\uDC00.")'
><td><input id=
"h3"><td>U+DC00 U+
002E
88 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"i3",
"\uDC00\uD800")'
><td><input id=
"i3"><td>U+DC00 U+D800
89 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"j3",
"\uDC00\uDBFF")'
><td><input id=
"j3"><td>U+DC00 U+DBFF
90 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"k3",
"\uDC00\uDC00")'
><td><input id=
"k3"><td>U+DC00 U+DC00
91 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"l3",
"\uDC00\uDFFF")'
><td><input id=
"l3"><td>U+DC00 U+DFFF
92 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"m3",
"\uDC00\uFF20")'
><td><input id=
"m3"><td>U+DC00 U+FF20
93 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"n3",
"\uDFFF")'
><td><input id=
"n3"><td>U+DFFF
94 <tr><td><input type=
"button" value=
"Test" onclick='run3(
"o3",
"\uDFFF\uDFFF")'
><td><input id=
"o3"><td>U+DFFF U+DFFF
95 <tr><td><input type=
"reset">
98 <script type=
"application/ecmascript">
99 function run3(name, accessKey) {
100 var form = window.document.forms[
"form3"];
101 var element = form.elements[name];
102 element.accessKey = accessKey;
103 if (element.accessKey != accessKey)
104 element.value =
"different " + accessKey +
"/" + element.accessKey;
106 element.value =
"same " + accessKey +
"/" + element.accessKey;