child-nodes-cache.html revision eff69b907ef2cd3a9af0351287a929c66f58e3f6
1<body onload="test()">
2<p>Running test...</p>
3<textarea id=t rows=20>textarea</textarea>
4<script>
5if (window.layoutTestController) {
6    layoutTestController.dumpAsText();
7    layoutTestController.waitUntilDone();
8}
9
10function gc()
11{
12    if (window.GCController)
13        return GCController.collect();
14
15    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
16        var s = new String("abc");
17    }
18}
19
20function test()
21{
22    var elem = document.getElementById("t");
23    var nodes = document.getElementById("t").getAttributeNode('rows').childNodes;
24    nodes[0]; // Prime the child node cache.
25    document.body.removeChild(document.getElementById("t"));
26    elem.getAttributeNode('rows').removeChild(nodes[0]);
27    setTimeout(function() {
28        gc();
29        gc();
30        gc();
31        try { nodes[0].textContent } catch (ex) { }
32
33        document.getElementsByTagName("p")[0].innerHTML = "PASS"
34        if (window.layoutTestController)
35            layoutTestController.notifyDone();
36    }, 0);
37}
38</script>
39