close-on-closedWindow.html 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html lang="en">
  4. <head>
  5. </head>
  6. <body>
  7. <p><b>BUG ID:</b> <a href="rdar://problem/4094363">rdar://problem/4094363</a> Can't re-open a window at capripalace.com website because "close" fails on already-closed window</p>
  8. <p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b>
  9. <ol>
  10. <li>Click the link below </li>
  11. <li>Close the window that opens </li>
  12. <li>Click the link again </li>
  13. </ol>
  14. </p>
  15. <p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>
  16. If the bug is fixed, a window WILL OPEN after Step #3.
  17. </p>
  18. <p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>
  19. If the bug is not fixed, a window WILL NOT OPEN after Step #3.
  20. </p>
  21. <script language="JavaScript">
  22. win = null;
  23. function win_open() {
  24. if (win != null) {
  25. win.close();
  26. }
  27. win = window.open('about:blank');
  28. }
  29. </script>
  30. <a href="javascript:win_open();">Click this link</a>
  31. </body>
  32. </html>