1 <html> 2 <body> 3 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=13514">bug 13514</a>: 4 REGRESSION (r20997-21003): Crash in WebCore::Node::Document.</p> 5 <div id="elem"><p></p></div> 6 7 <script> 8 if (window.layoutTestController) 9 layoutTestController.dumpAsText(); 10 11 function gc() 12 { 13 if (window.GCController) 14 return GCController.collect(); 15 16 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) 17 var s = new String(""); 18 } 19 } 20 21 elem = document.getElementById('elem'); 22 23 elem.childNodes.length; 24 elem.childNodes[0].length; 25 gc(); 26 elem.innerHTML = ""; 27 gc(); 28 elem.childNodes[0]; 29 if (elem.childNodes.length == 0) 30 document.write("SUCCESS"); 31 else 32 document.write("FAILURE: childNodes.length was cached inappropriately"); 33 34 </script> 35 </body> 36 </html> 37