summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DOMImplementation/detached-doctype.html
blob: a508f82cd695cbf5c49d04ccc1bec40817647675 (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
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=26402">bug 26402<a/>: Crashes when using a detached DocumentType node.</p>
<p>PASS if no crash.</p>
<SCRIPT>
function gc()
{
    if (window.GCController)
        return GCController.collect();

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

if (window.layoutTestController)
    layoutTestController.dumpAsText();

var o = document.implementation.createDocumentType('x', null, null);
var doc = document.implementation.createDocument("doc", null, 0);
for (i in o) {
    try { o[i]; } catch (e) {}
    try { o[i](); } catch (e) {}
}
o.addEventListener("click", function() {}, true);
o.removeEventListener("click", function() {}, true);
o.childNodes;
o.childNodes.item(0);
o.firstChild;
gc();
document.write("DONE");
</SCRIPT>