| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <script src="../../../resources/gc.js"></script> |
| 3 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=13514">bug 13514</a>
: | 4 <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 REGRESSION (r20997-21003): Crash in WebCore::Node::Document.</p> |
| 5 <div id="elem"><p></p></div> | 6 <div id="elem"><p></p></div> |
| 6 | 7 |
| 7 <script> | 8 <script> |
| 8 if (window.testRunner) | 9 if (window.testRunner) |
| 9 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 10 | 11 |
| 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'); | 12 elem = document.getElementById('elem'); |
| 22 | 13 |
| 23 elem.childNodes.length; | 14 elem.childNodes.length; |
| 24 elem.childNodes[0].length; | 15 elem.childNodes[0].length; |
| 25 gc(); | 16 gc(); |
| 26 elem.innerHTML = ""; | 17 elem.innerHTML = ""; |
| 27 gc(); | 18 gc(); |
| 28 elem.childNodes[0]; | 19 elem.childNodes[0]; |
| 29 if (elem.childNodes.length == 0) | 20 if (elem.childNodes.length == 0) |
| 30 document.write("SUCCESS"); | 21 document.write("SUCCESS"); |
| 31 else | 22 else |
| 32 document.write("FAILURE: childNodes.length was cached inappropriately"); | 23 document.write("FAILURE: childNodes.length was cached inappropriately"); |
| 33 | 24 |
| 34 </script> | 25 </script> |
| 35 </body> | 26 </body> |
| 36 </html> | 27 </html> |
| OLD | NEW |