1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug585978.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=585978 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 585978</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=585978">Mozilla Bug 585978</a> 1.16 + 1.17 +<script type="application/javascript;version=1.7"> 1.18 + 1.19 +/* Test that if we have a unicode character in the middle of an ascii string, 1.20 + the unicode character survives translation into and out of a text node. */ 1.21 + 1.22 +for (let i = 0; i < 128; i++) { 1.23 + let node = document.createTextNode(''); 1.24 + let str = ''; 1.25 + for (let j = 0; j < i; j++) { 1.26 + str += 'a'; 1.27 + } 1.28 + str += '\uA0A9' 1.29 + node.data = str; 1.30 + 1.31 + for (let j = 0; j < 32; j++) { 1.32 + is(node.data, str); 1.33 + 1.34 + str += 'b'; 1.35 + node.appendData('b'); 1.36 + } 1.37 +} 1.38 + 1.39 +</script> 1.40 +</body> 1.41 +</html>