test_bug572406.html (1363B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=572406 5 --> 6 <head> 7 <title>Test for Bug 572406</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 onload='runTests();'> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=572406">Mozilla Bug 572406</a> 13 <p id="display"></p> 14 <div id='content'> 15 <textarea id='i'>foo</textarea> 16 </div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 20 /** Test for Bug 572406 */ 21 22 SimpleTest.waitForExplicitFinish(); 23 24 function runTests() 25 { 26 var textarea = document.getElementById('i'); 27 28 textarea.firstChild.nodeValue = "bar"; 29 is(textarea.value, textarea.firstChild.nodeValue, 30 "textarea value should be firstChild.nodeValue"); 31 is(textarea.defaultValue, textarea.firstChild.nodeValue, 32 "textarea defaultValue should be firstChild.nodeValue"); 33 34 textarea.style.display = 'none'; 35 SimpleTest.executeSoon(function() { 36 textarea.firstChild.nodeValue = "tulip"; 37 is(textarea.value, textarea.firstChild.nodeValue, 38 "textarea value should be firstChild.nodeValue"); 39 is(textarea.defaultValue, textarea.firstChild.nodeValue, 40 "textarea defaultValue should be firstChild.nodeValue"); 41 SimpleTest.finish(); 42 }); 43 } 44 45 </script> 46 </pre> 47 </body> 48 </html>