detached-doctype.html revision eff69b907ef2cd3a9af0351287a929c66f58e3f6
1<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>
2<p>PASS if no crash.</p>
3<SCRIPT>
4function gc()
5{
6    if (window.GCController)
7        return GCController.collect();
8
9    for (var i = 0; i < 10000; i++)
10        var s = new String("");
11}
12
13if (window.layoutTestController)
14    layoutTestController.dumpAsText();
15
16var o = document.implementation.createDocumentType('x', null, null);
17var doc = document.implementation.createDocument("doc", null, 0);
18for (i in o) {
19    try { o[i]; } catch (e) {}
20    try { o[i](); } catch (e) {}
21}
22o.addEventListener("click", function() {}, true);
23o.removeEventListener("click", function() {}, true);
24o.childNodes;
25o.childNodes.item(0);
26o.firstChild;
27gc();
28document.write("DONE");
29</SCRIPT>
30