summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/stale-currentEvent.html
blob: e9dfcfc291f2708c503f3e31151a1a780515d029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
    <script type="text/javascript">
        var inner_win;

        function open_inner()
        {
            var src = 'data:text/html,<title>Pop up</title><input type="button" value="Close" onclick="opener.closeChild()">';
            var tp = document.getElementById("theparent");
            inner_win = window.open(src, 'inner', 'width=200, height=200, left=' + (screenLeft + tp.offsetLeft) + ', top=' + (screenTop + outerHeight - innerHeight + tp.offsetTop));
        }

        function removeHoverNode()
        {
            var tp = document.getElementById("theparent");
            tp.parentNode.removeChild(tp);
            setTimeout(reportSuccess, 500);
        }

        function reportSuccess()
        {
            document.body.appendChild(document.createTextNode("SUCCESS"));
        }

        function closeChild()
        {
            inner_win.close();
            document.body.offsetTop;
            setTimeout(removeHoverNode, 100);
        }
    </script>
</head>
<body>
<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>

<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b><br>
    1. Click the Open button below. A pop up window will open.<br>
    2. In the pop up window, click the Close button, being careful not to
    move the mouse during and shortly after clicking.
</p>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
    The black square will be replaced by the word &ldquo;SUCCESS&rdquo; and Safari will not crash.
</p>

<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
    Safari will crash (the word &ldquo;SUCCESS&rdquo; may appear before the crash).
</p>
    <div id='theparent'>
        <input type="button" value="Open" onclick="open_inner()">
        <div style="background: black; width: 200px; height:200px">
        </div>
    </div>
</body>
</html>