4 testRunner
.dumpAsText();
6 var types
= [ XPathResult
.UNORDERED_NODE_SNAPSHOT_TYPE
,
7 XPathResult
.ORDERED_NODE_SNAPSHOT_TYPE
];
11 if (window
.GCController
)
12 return GCController
.collect();
14 for (var i
= 0; i
< 10000; i
++) { // > force garbage collection (FF requires about 9K allocations before a collect)
15 var s
= new String("abc");
21 var result
= document
.evaluate("//div", document
.documentElement
, null, type
, null);
22 result
.snapshotItem(0).foo
= "PASS";
23 document
.body
.removeChild(result
.snapshotItem(0));
25 var console
= document
.getElementById("console");
26 console
.appendChild(document
.createTextNode(result
.snapshotItem(0).foo
));
27 console
.appendChild(document
.createElement("br"));
32 while (types
.length
) {
38 <body onload=
"tests()">
41 <div> Test for bug
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=34231">34231</a>: Nodes in XPath result snapshots should keep JS wrappers alive.
</div>
42 <div> For this test to PASS you should see
2 PASS below.
</div><br>
43 <div id=
"console"></div>