Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / containerNode.html
blob18cd958ef9d20d6e36492e5912f2b24e4a8824b2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="text/javascript">
5 function log(msg)
7 document.body.appendChild(document.createTextNode(msg));
10 function appendItem(list, caption)
12 var item = document.createElement('li');
13 item.appendChild(document.createTextNode(caption));
14 list.appendChild(item);
17 function runTests()
19 if (window.testRunner)
20 testRunner.dumpAsText();
22 var fragment = document.createDocumentFragment();
23 var list = document.createElement('ul');
24 var i;
25 for (i = 0; i < 5; i++)
26 appendItem(list, 'item ' + i);
28 fragment.appendChild(list);
29 document.addEventListener("DOMNodeRemoved", function() {
30 appendItem(list, 'item ' + i++);
31 }, false);
33 document.body.appendChild(fragment);
34 list.textContent = '';
36 if (list.childNodes.length == 0)
37 log('PASS: No infinite loop.')
38 else
39 log('FAIL: Has too many children.')
41 </script>
42 </head>
43 <body onload="runTests();">
45 </body>
46 </html>