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