123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <!DOCTYPE HTML>
- <html>
- <!--
- https://bugzilla.mozilla.org/show_bug.cgi?id=445886
- -->
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
- <title>Test for Unicode non-characters</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
- </head>
- <body onload="Inject()">
- <pre id="test">
- <script class="testbody" type="text/javascript">
- /** Test that unicode non-characters are not discarded **/
- function test()
- {
- is($("display").innerHTML, "All good.", "Noncharacters not stripped");
- SimpleTest.finish();
- }
- function Inject()
- {
- // script fragments containing Unicode non-characters
- try {
- // U+FDD0
- eval("$(\"display\").innerHTML += \" U+FDD0 is evil \"");
- } catch(e) {}
- try {
- // U+FDD1
- eval("$(\"display\").innerHTML += \" U+FDD1 is evil \"");
- } catch(e) {}
- try {
- // U+FDD2
- eval("$(\"display\").innerHTML += \" U+FDD2 is evil \"");
- } catch(e) {}
- try {
- // U+FDD3
- eval("$(\"display\").innerHTML += \" U+FDD3 is evil \"");
- } catch(e) {}
- try {
- // U+FDD4
- eval("$(\"display\").innerHTML += \" U+FDD4 is evil \"");
- } catch(e) {}
- try {
- // U+FDD5
- eval("$(\"display\").innerHTML += \" U+FDD5 is evil \"");
- } catch(e) {}
- try {
- // U+FDD6
- eval("$(\"display\").innerHTML += \" U+FDD6 is evil \"");
- } catch(e) {}
- try {
- // U+FDD7
- eval("$(\"display\").innerHTML += \" U+FDD7 is evil \"");
- } catch(e) {}
- try {
- // U+FDD8
- eval("$(\"display\").innerHTML += \" U+FDD8 is evil \"");
- } catch(e) {}
- try {
- // U+FDD9
- eval("$(\"display\").innerHTML += \" U+FDD9 is evil \"");
- } catch(e) {}
- try {
- // U+FDDA
- eval("$(\"display\").innerHTML += \" U+FDDA is evil \"");
- } catch(e) {}
- try {
- // U+FDDB
- eval("$(\"display\").innerHTML += \" U+FDDB is evil \"");
- } catch(e) {}
- try {
- // U+FDDC
- eval("$(\"display\").innerHTML += \" U+FDDC is evil \"");
- } catch(e) {}
- try {
- // U+FDDD
- eval("$(\"display\").innerHTML += \" U+FDDD is evil \"");
- } catch(e) {}
- try {
- // U+FDDE
- eval("$(\"display\").innerHTML += \" U+FDDE is evil \"");
- } catch(e) {}
- try {
- // U+FDDF
- eval("$(\"display\").innerHTML += \" U+FDDF is evil \"");
- } catch(e) {}
- try {
- // U+FDE0
- eval("$(\"display\").innerHTML += \" U+FDE0 is evil \"");
- } catch(e) {}
- try {
- // U+FDE1
- eval("$(\"display\").innerHTML += \" U+FDE1 is evil \"");
- } catch(e) {}
- try {
- // U+FDE2
- eval("$(\"display\").innerHTML += \" U+FDE2 is evil \"");
- } catch(e) {}
- try {
- // U+FDE3
- eval("$(\"display\").innerHTML += \" U+FDE3 is evil \"");
- } catch(e) {}
- try {
- // U+FDE4
- eval("$(\"display\").innerHTML += \" U+FDE4 is evil \"");
- } catch(e) {}
- try {
- // U+FDE5
- eval("$(\"display\").innerHTML += \" U+FDE5 is evil \"");
- } catch(e) {}
- try {
- // U+FDE6
- eval("$(\"display\").innerHTML += \" U+FDE6 is evil \"");
- } catch(e) {}
- try {
- // U+FDE7
- eval("$(\"display\").innerHTML += \" U+FDE7 is evil \"");
- } catch(e) {}
- try {
- // U+FDE8
- eval("$(\"display\").innerHTML += \" U+FDE8 is evil \"");
- } catch(e) {}
- try {
- // U+FDE9
- eval("$(\"display\").innerHTML += \" U+FDE9 is evil \"");
- } catch(e) {}
- try {
- // U+FDEA
- eval("$(\"display\").innerHTML += \" U+FDEA is evil \"");
- } catch(e) {}
- try {
- // U+FDEB
- eval("$(\"display\").innerHTML += \" U+FDEB is evil \"");
- } catch(e) {}
- try {
- // U+FDEC
- eval("$(\"display\").innerHTML += \" U+FDEC is evil \"");
- } catch(e) {}
- try {
- // U+FDED
- eval("$(\"display\").innerHTML += \" U+FDED is evil \"");
- } catch(e) {}
- try {
- // U+FDEE
- eval("$(\"display\").innerHTML += \" U+FDEE is evil \"");
- } catch(e) {}
- try {
- // U+FDEF
- eval("$(\"display\").innerHTML += \" U+FDEF is evil \"");
- } catch(e) {}
- try {
- // U+FFFE
- eval("$(\"display\").innerHTML += \" U+FFFE is evil \"");
- } catch(e) {}
- try {
- // U+FFFF
- eval("$(\"display\").innerHTML += \" U+FFFF is evil \"");
- } catch(e) {}
- try {
- // U+1FFFE
- eval("$(\"display\").innerHTML += \" U+1FFFE is evil \"");
- } catch(e) {}
- try {
- // U+1FFFF
- eval("$(\"display\").innerHTML += \" U+1FFFF is evil \"");
- } catch(e) {}
- try {
- // U+2FFFE
- eval("$(\"display\").innerHTML += \" U+2FFFE is evil \"");
- } catch(e) {}
- try {
- // U+2FFFF
- eval("$(\"display\").innerHTML += \" U+2FFFF is evil \"");
- } catch(e) {}
- try {
- // U+3FFFE
- eval("$(\"display\").innerHTML += \" U+3FFFE is evil \"");
- } catch(e) {}
- try {
- // U+3FFFF
- eval("$(\"display\").innerHTML += \" U+3FFFF is evil \"");
- } catch(e) {}
- try {
- // U+4FFFE
- eval("$(\"display\").innerHTML += \" U+4FFFE is evil \"");
- } catch(e) {}
- try {
- // U+4FFFF
- eval("$(\"display\").innerHTML += \" U+4FFFF is evil \"");
- } catch(e) {}
- try {
- // U+5FFFE
- eval("$(\"display\").innerHTML += \" U+5FFFE is evil \"");
- } catch(e) {}
- try {
- // U+5FFFF
- eval("$(\"display\").innerHTML += \" U+5FFFF is evil \"");
- } catch(e) {}
- try {
- // U+6FFFE
- eval("$(\"display\").innerHTML += \" U+6FFFE is evil \"");
- } catch(e) {}
- try {
- // U+6FFFF
- eval("$(\"display\").innerHTML += \" U+6FFFF is evil \"");
- } catch(e) {}
- try {
- // U+7FFFE
- eval("$(\"display\").innerHTML += \" U+7FFFE is evil \"");
- } catch(e) {}
- try {
- // U+7FFFF
- eval("$(\"display\").innerHTML += \" U+7FFFF is evil \"");
- } catch(e) {}
- try {
- // U+8FFFE
- eval("$(\"display\").innerHTML += \" U+8FFFE is evil \"");
- } catch(e) {}
- try {
- // U+8FFFF
- eval("$(\"display\").innerHTML += \" U+8FFFF is evil \"");
- } catch(e) {}
- try {
- // U+9FFFE
- eval("$(\"display\").innerHTML += \" U+9FFFE is evil \"");
- } catch(e) {}
- try {
- // U+9FFFF
- eval("$(\"display\").innerHTML += \" U+9FFFF is evil \"");
- } catch(e) {}
- try {
- // U+AFFFE
- eval("$(\"display\").innerHTML += \" U+AFFFE is evil \"");
- } catch(e) {}
- try {
- // U+AFFFF
- eval("$(\"display\").innerHTML += \" U+AFFFF is evil \"");
- } catch(e) {}
- try {
- // U+BFFFE
- eval("$(\"display\").innerHTML += \" U+BFFFE is evil \"");
- } catch(e) {}
- try {
- // U+BFFFF
- eval("$(\"display\").innerHTML += \" U+BFFFF is evil \"");
- } catch(e) {}
- try {
- // U+CFFFE
- eval("$(\"display\").innerHTML += \" U+CFFFE is evil \"");
- } catch(e) {}
- try {
- // U+CFFFF
- eval("$(\"display\").innerHTML += \" U+CFFFF is evil \"");
- } catch(e) {}
- try {
- // U+DFFFE
- eval("$(\"display\").innerHTML += \" U+DFFFE is evil \"");
- } catch(e) {}
- try {
- // U+DFFFF
- eval("$(\"display\").innerHTML += \" U+DFFFF is evil \"");
- } catch(e) {}
- try {
- // U+EFFFE
- eval("$(\"display\").innerHTML += \" U+EFFFE is evil \"");
- } catch(e) {}
- try {
- // U+EFFFF
- eval("$(\"display\").innerHTML += \" U+EFFFF is evil \"");
- } catch(e) {}
- try {
- // U+FFFFE
- eval("$(\"display\").innerHTML += \" U+FFFFE is evil \"");
- } catch(e) {}
- try {
- // U+FFFFF
- eval("$(\"display\").innerHTML += \" U+FFFFF is evil \"");
- } catch(e) {}
- try {
- // U+10FFFE
- eval("$(\"display\").innerHTML += \" U+10FFFE is evil \"");
- } catch(e) {}
- try {
- // U+10FFFF
- eval("$(\"display\").innerHTML += \" U+10FFFF is evil \"");
- } catch(e) {}
- test();
- }
- SimpleTest.waitForExplicitFinish();
- </script>
- </pre>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445886">Mozilla Bug 445886</a>
- <p id="display">All good.</p>
- <div id="content" style="display: none"></div>
- </body>
- </html>
|