test_bug611189.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  10. <script type="text/javascript" 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. /** Test for Bug 611189 **/
  21. SimpleTest.waitForExplicitFinish();
  22. addLoadEvent(function() {
  23. var i = document.createElement("input");
  24. var b = document.getElementById("content");
  25. b.appendChild(i);
  26. b.clientWidth; // bind to frame
  27. i.focus(); // initialize editor
  28. var before = snapshotWindow(window, true);
  29. i.value = "L"; // set the value
  30. i.style.display = "none";
  31. b.clientWidth; // unbind from frame
  32. i.value = ""; // set the value without a frame
  33. i.style.display = "";
  34. b.clientWidth; // rebind to frame
  35. is(i.value, "", "Input's value should be correctly updated");
  36. var after = snapshotWindow(window, true);
  37. ok(compareSnapshots(before, after, true), "The correct value should be rendered inside the control");
  38. SimpleTest.finish();
  39. });
  40. </script>
  41. </pre>
  42. </body>
  43. </html>