diff options
Diffstat (limited to 'LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html')
-rw-r--r-- | LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html new file mode 100644 index 0000000..de47e39 --- /dev/null +++ b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html @@ -0,0 +1,36 @@ +<html> +<body> +<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=13514">bug 13514</a>: +REGRESSION (r20997-21003): Crash in WebCore::Node::Document.</p> +<div id="elem"><p></p></div> + +<script> +if (window.layoutTestController) + layoutTestController.dumpAsText(); + +function gc() +{ + if (window.GCController) + return GCController.collect(); + + for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) + var s = new String(""); + } +} + +elem = document.getElementById('elem'); + +elem.childNodes.length; +elem.childNodes[0].length; +gc(); +elem.innerHTML = ""; +gc(); +elem.childNodes[0]; +if (elem.childNodes.length == 0) + document.write("SUCCESS"); +else + document.write("FAILURE: childNodes.length was cached inappropriately"); + +</script> +</body> +</html> |