tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug585978.html (890B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=585978
      5 -->
      6 <head>
      7  <title>Test for Bug 585978</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=585978">Mozilla Bug 585978</a>
     13 
     14 <script type="application/javascript">
     15 
     16 /* Test that if we have a unicode character in the middle of an ascii string,
     17   the unicode character survives translation into and out of a text node. */
     18 
     19 for (let i = 0; i < 128; i++) {
     20  let node = document.createTextNode('');
     21  let str = '';
     22  for (let j = 0; j < i; j++) {
     23    str += 'a';
     24  }
     25  str += '\uA0A9'
     26  node.data = str;
     27 
     28  for (let j = 0; j < 32; j++) {
     29    is(node.data, str);
     30 
     31    str += 'b';
     32    node.appendData('b');
     33  }
     34 }
     35 
     36 </script>
     37 </body>
     38 </html>