summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/change-form-element-document-crash.html
blob: 47e425796112750dc94a96b85e62a18fccdbbe0e (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
<html>
<head>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

function gc() {
    if (window.GCController)
        return GCController.collect();

    for (var i = 0; i < 10000; i++)
        var s = new String("abc");
}

function crash_test(element_name) {
    var element = document.createElement(element_name);
    element.setAttribute('form', '1');
    var container = document.createElement('div');
    container.appendChild(element);
    document.implementation.createDocument(null, '').adoptNode(container);
    container.removeChild(element);
    delete element;
    gc();
    var form = document.createElement('form');
    form.setAttribute('id', '2');
    document.body.appendChild(form)
}

function test() {
    crash_test('input');
    crash_test('object');
    document.body.innerHTML += "PASS";
}
</script>
</head>
<body onload="test()">
<p>
This page is a test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=51418">Bug 51418</a>. WebKit should not crash when this page is loaded.
</p>
</body>
</html>