WebCore:
[WebKit.git] / LayoutTests / fast / dom / gc-11.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4 <script>
5 if (window.layoutTestController) {
6     layoutTestController.dumpAsText();
7     layoutTestController.waitUntilDone();
8 }
9 </script>
10   <script type="text/javascript">
11     var xmlNode = null;
12
13     loadData();
14     setTimeout("testData()", 0);
15
16     function testData() {
17         var i = 0;
18         var s;
19         while (i < 5000) {
20             i = i+1.11;
21             s = s + " ";
22         }
23         
24         document.write(xmlNode.ownerDocument.data ? "<p>SUCCESS</p>" : "<p>FAILURE</p>");
25         if (window.layoutTestController)
26              layoutTestController.notifyDone();
27     }
28
29     function loadData() {
30         var xmlDoc = document.implementation.createDocument("", "doc", null);
31         if (!xmlDoc.documentElement)
32             xmlDoc.appendChild(document.createElement("doc"));
33         xmlNode = xmlDoc.documentElement;
34         xmlNode.ownerDocument.data = 1;
35      }
36   </script>
37  </head>
38  <body>
39 This test checks that custom data on reachable DOM nodes is not lost during GC. If it passes, it should say SUCCESS below.
40  </body>
41 </html>