blob: f21aad6b461153fee5cd65ef89cab02d6e7ff86b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
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("abc");
}
}
function runTest()
{
iteratorRoot = document.createElement('div');
element = iteratorRoot.appendChild(document.createElement('div'));
element.appendChild(document.createElement('div'));
iterator = document.createNodeIterator(iteratorRoot, -1);
iterator.nextNode(); iterator.nextNode(); iterator.nextNode();
iterator.previousNode();
iteratorRoot.removeChild(element);
otherDocument = document.implementation.createHTMLDocument();
otherDocument.body.appendChild(iteratorRoot);
delete iterator;
gc();
div = document.body.appendChild(document.createElement('div'));
document.body.removeChild(div);
gc();
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body onload="runTest()">
Test passes if it does not crash.
</body>
</html>
|