test_bug611189.html (1413B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=611189 5 --> 6 <head> 7 <title>Test for Bug 611189</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 </head> 13 <body> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=611189">Mozilla Bug 611189</a> 15 <p id="display"></p> 16 <div id="content"> 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 611189 */ 22 SimpleTest.waitForExplicitFinish(); 23 addLoadEvent(async function() { 24 var i = document.createElement("input"); 25 var b = document.getElementById("content"); 26 b.appendChild(i); 27 b.clientWidth; // bind to frame 28 i.focus(); // initialize editor 29 var before = await snapshotWindow(window, true); 30 i.value = "L"; // set the value 31 i.style.display = "none"; 32 b.clientWidth; // unbind from frame 33 i.value = ""; // set the value without a frame 34 i.style.display = ""; 35 b.clientWidth; // rebind to frame 36 is(i.value, "", "Input's value should be correctly updated"); 37 var after = await snapshotWindow(window, true); 38 ok(compareSnapshots(before, after, true), "The correct value should be rendered inside the control"); 39 SimpleTest.finish(); 40 }); 41 42 </script> 43 </pre> 44 </body> 45 </html>