Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / gc-3.html
blobea902a3a7bc8651372cf982e42ef87881ae2c412
1 <head>
2 <script>
3 function doit()
5 B = document.getElementById("span-B");
6 B.customProperty = "B";
8 document.getElementById("div").innerHTML = "<span>replacement content</span>";
10 // create lots of objects to force a garbage collection
11 var i = 0;
12 var s;
13 while (i < 5000) {
14 i = i+1.11;
15 s = s + " ";
18 var output= document.getElementById("output");
20 output.innerHTML += B.customProperty + "<BR>";
21 if (B.parentNode) {
22 output.innerHTML += "parent node exists<BR>";
24 if (B.firstChild) {
25 output.innerHTML += "child node exists<BR>";
29 if (window.testRunner) {
30 testRunner.dumpAsText();
33 </script>
34 </head>
36 <body onload="doit()">
37 <div style="border: 1px solid red">
38 <p>
39 This test verifies that DOM nodes are retained because a wrapper exists for a descendant. A wrapper need not exist for the node itself or for an ancestor.
40 </p>
41 <p>
42 The output should be the following pieces of text on lines by themselves: "replacement content", "B", "parent node exists", "child node exists".
43 </p>
44 </div>
45 <div id="div">
46 <span id="span-A"><span id="span-B"><span id="span-C">original span</span></span></span>
47 </div>
48 <div id="output">
49 </div>
50 </body>