2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / gc-1.html
blobe29c5733363286aed1141484e9dff42a5a6055cd
1 <head>
2 <script>
3 function doit()
5 document.getElementById("span-B").customProperty = "B";
7 // create lots of objects to force a garbage collection
8 var i = 0;
9 var s;
10 while (i < 5000) {
11 i = i+1.11;
12 s = s + " ";
15 var output= document.getElementById("output");
17 output.innerHTML += document.getElementById("span-B").customProperty + "<BR>";
20 if (window.layoutTestController) {
21 layoutTestController.dumpAsText();
24 </script>
25 </head>
27 <body onload="doit()">
28 <div style="border: 1px solid red">
29 <p>
30 This test verifies that JavaScript wrappers for DOM nodes are
31 protected against garbage collection as long as the node remains in
32 the document (so custom properties are preserved).
33 </p>
34 <p>
35 The output should be the following pieces of text on lines by themselves: "original span", "B":
36 </p>
37 </div>
38 <div id="div">
39 <span id="span-A"><span id="span-B"><span id="span-C">original span</span></span></span>
40 </div>
41 <div id="output">
42 </div>
43 </body>