Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / intl / uconv / tests / test_unicode_noncharacterescapes.html
blobe44f8d782b7a486ae26708c59ef55fd1907a6341
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=445886
5 -->
6 <head>
7 <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
8 <title>Test for Unicode non-characters</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 </head>
12 <body onload="Inject()">
13 <pre id="test">
14 <script class="testbody" type="text/javascript">
16 /* eslint-disable no-eval */
18 /** Test that unicode non-characters are not discarded **/
19 function test()
21 is($("display").innerHTML,"All good.", "Noncharacters not stripped");
22 SimpleTest.finish();
25 // eslint-disable-next-line complexity
26 function Inject()
28 // script fragments containing Unicode non-characters
29 try {
30 // U+FDD0
31 eval("$(\"display\").inner\ufdd0HTML += \" U+FDD0 is evil\"");
32 } catch(e) {}
33 try {
34 // U+FDD1
35 eval("$(\"display\").inner\ufdd1HTML += \" U+FDD1 is evil\"");
36 } catch(e) {}
37 try {
38 // U+FDD2
39 eval("$(\"display\").inner\ufdd2HTML += \" U+FDD2 is evil\"");
40 } catch(e) {}
41 try {
42 // U+FDD3
43 eval("$(\"display\").inner\ufdd3HTML += \" U+FDD3 is evil\"");
44 } catch(e) {}
45 try {
46 // U+FDD4
47 eval("$(\"display\").inner\ufdd4HTML += \" U+FDD4 is evil\"");
48 } catch(e) {}
49 try {
50 // U+FDD5
51 eval("$(\"display\").inner\ufdd5HTML += \" U+FDD5 is evil\"");
52 } catch(e) {}
53 try {
54 // U+FDD6
55 eval("$(\"display\").inner\ufdd6HTML += \" U+FDD6 is evil\"");
56 } catch(e) {}
57 try {
58 // U+FDD7
59 eval("$(\"display\").inner\ufdd7HTML += \" U+FDD7 is evil\"");
60 } catch(e) {}
61 try {
62 // U+FDD8
63 eval("$(\"display\").inner\ufdd8HTML += \" U+FDD8 is evil\"");
64 } catch(e) {}
65 try {
66 // U+FDD9
67 eval("$(\"display\").inner\ufdd9HTML += \" U+FDD9 is evil\"");
68 } catch(e) {}
69 try {
70 // U+FDDA
71 eval("$(\"display\").inner\ufddaHTML += \" U+FDDA is evil\"");
72 } catch(e) {}
73 try {
74 // U+FDDB
75 eval("$(\"display\").inner\ufddbHTML += \" U+FDDB is evil\"");
76 } catch(e) {}
77 try {
78 // U+FDDC
79 eval("$(\"display\").inner\ufddcHTML += \" U+FDDC is evil\"");
80 } catch(e) {}
81 try {
82 // U+FDDD
83 eval("$(\"display\").inner\ufdddHTML += \" U+FDDD is evil\"");
84 } catch(e) {}
85 try {
86 // U+FDDE
87 eval("$(\"display\").inner\ufddeHTML += \" U+FDDE is evil\"");
88 } catch(e) {}
89 try {
90 // U+FDDF
91 eval("$(\"display\").inner\ufddfHTML += \" U+FDDF is evil\"");
92 } catch(e) {}
93 try {
94 // U+FDE0
95 eval("$(\"display\").inner\ufde0HTML += \" U+FDE0 is evil\"");
96 } catch(e) {}
97 try {
98 // U+FDE1
99 eval("$(\"display\").inner\ufde1HTML += \" U+FDE1 is evil\"");
100 } catch(e) {}
101 try {
102 // U+FDE2
103 eval("$(\"display\").inner\ufde2HTML += \" U+FDE2 is evil\"");
104 } catch(e) {}
105 try {
106 // U+FDE3
107 eval("$(\"display\").inner\ufde3HTML += \" U+FDE3 is evil\"");
108 } catch(e) {}
109 try {
110 // U+FDE4
111 eval("$(\"display\").inner\ufde4HTML += \" U+FDE4 is evil\"");
112 } catch(e) {}
113 try {
114 // U+FDE5
115 eval("$(\"display\").inner\ufde5HTML += \" U+FDE5 is evil\"");
116 } catch(e) {}
117 try {
118 // U+FDE6
119 eval("$(\"display\").inner\ufde6HTML += \" U+FDE6 is evil\"");
120 } catch(e) {}
121 try {
122 // U+FDE7
123 eval("$(\"display\").inner\ufde7HTML += \" U+FDE7 is evil\"");
124 } catch(e) {}
125 try {
126 // U+FDE8
127 eval("$(\"display\").inner\ufde8HTML += \" U+FDE8 is evil\"");
128 } catch(e) {}
129 try {
130 // U+FDE9
131 eval("$(\"display\").inner\ufde9HTML += \" U+FDE9 is evil\"");
132 } catch(e) {}
133 try {
134 // U+FDEA
135 eval("$(\"display\").inner\ufdeaHTML += \" U+FDEA is evil\"");
136 } catch(e) {}
137 try {
138 // U+FDEB
139 eval("$(\"display\").inner\ufdebHTML += \" U+FDEB is evil\"");
140 } catch(e) {}
141 try {
142 // U+FDEC
143 eval("$(\"display\").inner\ufdecHTML += \" U+FDEC is evil\"");
144 } catch(e) {}
145 try {
146 // U+FDED
147 eval("$(\"display\").inner\ufdedHTML += \" U+FDED is evil\"");
148 } catch(e) {}
149 try {
150 // U+FDEE
151 eval("$(\"display\").inner\ufdeeHTML += \" U+FDEE is evil\"");
152 } catch(e) {}
153 try {
154 // U+FDEF
155 eval("$(\"display\").inner\ufdefHTML += \" U+FDEF is evil\"");
156 } catch(e) {}
157 try {
158 // U+FFFE
159 eval("$(\"display\").inner\ufffeHTML += \" U+FFFE is evil\"");
160 } catch(e) {}
161 try {
162 // U+FFFF
163 eval("$(\"display\").inner\uffffHTML += \" U+FFFF is evil\"");
164 } catch(e) {}
165 try {
166 // U+1FFFE
167 eval("$(\"display\").inner\ud83f\udffeHTML += \" U+1FFFE is evil\"");
168 } catch(e) {}
169 try {
170 // U+1FFFF
171 eval("$(\"display\").inner\ud83f\udfffHTML += \" U+1FFFF is evil\"");
172 } catch(e) {}
173 try {
174 // U+2FFFE
175 eval("$(\"display\").inner\ud87f\udffeHTML += \" U+2FFFE is evil\"");
176 } catch(e) {}
177 try {
178 // U+2FFFF
179 eval("$(\"display\").inner\ud87f\udfffHTML += \" U+2FFFF is evil\"");
180 } catch(e) {}
181 try {
182 // U+3FFFE
183 eval("$(\"display\").inner\ud8bf\udffeHTML += \" U+3FFFE is evil\"");
184 } catch(e) {}
185 try {
186 // U+3FFFF
187 eval("$(\"display\").inner\ud8bf\udfffHTML += \" U+3FFFF is evil\"");
188 } catch(e) {}
189 try {
190 // U+4FFFE
191 eval("$(\"display\").inner\ud8ff\udffeHTML += \" U+4FFFE is evil\"");
192 } catch(e) {}
193 try {
194 // U+4FFFF
195 eval("$(\"display\").inner\ud8ff\udfffHTML += \" U+4FFFF is evil\"");
196 } catch(e) {}
197 try {
198 // U+5FFFE
199 eval("$(\"display\").inner\ud93f\udffeHTML += \" U+5FFFE is evil\"");
200 } catch(e) {}
201 try {
202 // U+5FFFF
203 eval("$(\"display\").inner\ud93f\udfffHTML += \" U+5FFFF is evil\"");
204 } catch(e) {}
205 try {
206 // U+6FFFE
207 eval("$(\"display\").inner\ud97f\udffeHTML += \" U+6FFFE is evil\"");
208 } catch(e) {}
209 try {
210 // U+6FFFF
211 eval("$(\"display\").inner\ud97f\udfffHTML += \" U+6FFFF is evil\"");
212 } catch(e) {}
213 try {
214 // U+7FFFE
215 eval("$(\"display\").inner\ud9bf\udffeHTML += \" U+7FFFE is evil\"");
216 } catch(e) {}
217 try {
218 // U+7FFFF
219 eval("$(\"display\").inner\ud9bf\udfffHTML += \" U+7FFFF is evil\"");
220 } catch(e) {}
221 try {
222 // U+8FFFE
223 eval("$(\"display\").inner\ud9ff\udffeHTML += \" U+8FFFE is evil\"");
224 } catch(e) {}
225 try {
226 // U+8FFFF
227 eval("$(\"display\").inner\ud9ff\udfffHTML += \" U+8FFFF is evil\"");
228 } catch(e) {}
229 try {
230 // U+9FFFE
231 eval("$(\"display\").inner\uda3f\udffeHTML += \" U+9FFFE is evil\"");
232 } catch(e) {}
233 try {
234 // U+9FFFF
235 eval("$(\"display\").inner\uda3f\udfffHTML += \" U+9FFFF is evil\"");
236 } catch(e) {}
237 try {
238 // U+AFFFE
239 eval("$(\"display\").inner\uda7f\udffeHTML += \" U+AFFFE is evil\"");
240 } catch(e) {}
241 try {
242 // U+AFFFF
243 eval("$(\"display\").inner\uda7f\udfffHTML += \" U+AFFFF is evil\"");
244 } catch(e) {}
245 try {
246 // U+BFFFE
247 eval("$(\"display\").inner\udabf\udffeHTML += \" U+BFFFE is evil\"");
248 } catch(e) {}
249 try {
250 // U+BFFFF
251 eval("$(\"display\").inner\udabf\udfffHTML += \" U+BFFFF is evil\"");
252 } catch(e) {}
253 try {
254 // U+CFFFE
255 eval("$(\"display\").inner\udaff\udffeHTML += \" U+CFFFE is evil\"");
256 } catch(e) {}
257 try {
258 // U+CFFFF
259 eval("$(\"display\").inner\udaff\udfffHTML += \" U+CFFFF is evil\"");
260 } catch(e) {}
261 try {
262 // U+DFFFE
263 eval("$(\"display\").inner\udb3f\udffeHTML += \" U+DFFFE is evil\"");
264 } catch(e) {}
265 try {
266 // U+DFFFF
267 eval("$(\"display\").inner\udb3f\udfffHTML += \" U+DFFFF is evil\"");
268 } catch(e) {}
269 try {
270 // U+EFFFE
271 eval("$(\"display\").inner\udb7f\udffeHTML += \" U+EFFFE is evil\"");
272 } catch(e) {}
273 try {
274 // U+EFFFF
275 eval("$(\"display\").inner\udb7f\udfffHTML += \" U+EFFFF is evil\"");
276 } catch(e) {}
277 try {
278 // U+FFFFE
279 eval("$(\"display\").inner\udbbf\udffeHTML += \" U+FFFFE is evil\"");
280 } catch(e) {}
281 try {
282 // U+FFFFF
283 eval("$(\"display\").inner\udbbf\udfffHTML += \" U+FFFFF is evil\"");
284 } catch(e) {}
285 try {
286 // U+10FFFE
287 eval("$(\"display\").inner\udbff\udffeHTML += \" U+10FFFE is evil\"");
288 } catch(e) {}
289 try {
290 // U+10FFFF
291 eval("$(\"display\").inner\udbff\udfffHTML += \" U+10FFFF is evil\"");
292 } catch(e) {}
293 test();
296 SimpleTest.waitForExplicitFinish();
297 </script>
298 </pre>
299 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445886">Mozilla Bug 445886</a>
300 <p id="display">All good.</p>
301 <div id="content" style="display: none"></div>
302 </body>
303 </html>