summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-crash2.html
blob: 39d310a2f508185453d9579f4af3c1878f8cacbb (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
<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function gc() {
    var array = [];
    for (var i = 0x30000; i--; )
        if (!(Math.round(Math.random() * 20)))
            array = [];
        else
            array.push(new String(Math.random()))
}

function test()
{
    var element = document.createElement('input');
    element.setAttribute('form', 'form1');
    var div = document.createElement('div');
    div.appendChild(element);
    element.removeAttribute('form');
    div.innerHTML = '';
    element = 0;
    gc();
    setTimeout(delay, 0);
}

function delay()
{
    var form = document.createElement('form');
    form.setAttribute('id', 'form2');
    document.body.appendChild(form);
    location.reload();
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</head>
<body onload="test()">
<p>
This page is a test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=51905">Bug 51905</a>. WebKit should not crash when this page is loaded.
</p>
PASS
</body>
</html>