| <script type="text/javascript"> |
| document.body.appendChild(document.createTextNode(msg)); |
| function appendItem(list, caption) |
| var item = document.createElement('li'); |
| item.appendChild(document.createTextNode(caption)); |
| var fragment = document.createDocumentFragment(); |
| var list = document.createElement('ul'); |
| appendItem(list, 'item ' + i); |
| fragment.appendChild(list); |
| document.addEventListener("DOMNodeRemoved", function() { |
| appendItem(list, 'item ' + i++); |
| document.body.appendChild(fragment); |
| if (list.childNodes.length == 0) |
| log('PASS: No infinite loop.') |
| log('FAIL: Has too many children.') |
| <body onload="runTests();"> |