stale-currentEvent.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. <script type="text/javascript">
  6. var inner_win;
  7. function open_inner()
  8. {
  9. var src = 'data:text/html,<title>Pop up</title><input type="button" value="Close" onclick="opener.closeChild()">';
  10. var tp = document.getElementById("theparent");
  11. inner_win = window.open(src, 'inner', 'width=200, height=200, left=' + (screenLeft + tp.offsetLeft) + ', top=' + (screenTop + outerHeight - innerHeight + tp.offsetTop));
  12. }
  13. function removeHoverNode()
  14. {
  15. var tp = document.getElementById("theparent");
  16. tp.parentNode.removeChild(tp);
  17. setTimeout(reportSuccess, 500);
  18. }
  19. function reportSuccess()
  20. {
  21. document.body.appendChild(document.createTextNode("SUCCESS"));
  22. }
  23. function closeChild()
  24. {
  25. inner_win.close();
  26. document.body.offsetTop;
  27. setTimeout(removeHoverNode, 100);
  28. }
  29. </script>
  30. </head>
  31. <body>
  32. <p><b>BUG ID:</b> <a href="rdar://problem/5095977">5095997</a> (<a href="http://bugs.webkit.org/show_bug.cgi?id=13218">13218</a>) Reproducible crash after call to window.close()</p>
  33. <p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b><br>
  34. 1. Click the Open button below. A pop up window will open.<br>
  35. 2. In the pop up window, click the Close button, being careful not to
  36. move the mouse during and shortly after clicking.
  37. </p>
  38. <p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>
  39. The black square will be replaced by the word &ldquo;SUCCESS&rdquo; and Safari will not crash.
  40. </p>
  41. <p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>
  42. Safari will crash (the word &ldquo;SUCCESS&rdquo; may appear before the crash).
  43. </p>
  44. <div id='theparent'>
  45. <input type="button" value="Open" onclick="open_inner()">
  46. <div style="background: black; width: 200px; height:200px">
  47. </div>
  48. </div>
  49. </body>
  50. </html>