4 <script type=
"text/javascript">
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
);
19 if (window
.testRunner
)
20 testRunner
.dumpAsText();
22 var fragment
= document
.createDocumentFragment();
23 var list
= document
.createElement('ul');
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
++);
33 document
.body
.appendChild(fragment
);
34 list
.textContent
= '';
36 if (list
.childNodes
.length
== 0)
37 log('PASS: No infinite loop.')
39 log('FAIL: Has too many children.')
43 <body onload=
"runTests();">