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