test_utf8_overconsumption.html 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  11. <script type="text/javascript">
  12. function Inject()
  13. {
  14. $("display").innerHTML = "Evil";
  15. }
  16. </script>
  17. </head>
  18. <body Â>onload="Inject()">
  19. <pre id="test">
  20. <script class="testbody" type="text/javascript">
  21. /** test that UTF-8 decoding resynchronizes after incomplete sequences */
  22. function test()
  23. {
  24. is($("display").innerHTML, "All good.", "No overconsumption");
  25. SimpleTest.finish();
  26. }
  27. addLoadEvent(function() {
  28. setTimeout(test, 0);
  29. });
  30. SimpleTest.waitForExplicitFinish();
  31. </script>
  32. </pre>
  33. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445886">Mozilla Bug 445886</a>
  34. <p id="display">All good.</p>
  35. <div id="content" style="display: none"></div>
  36. </body>
  37. </html>