OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
5 function log(msg) | 5 function log(msg) |
6 { | 6 { |
7 document.body.appendChild(document.createTextNode(msg + '\n')); | 7 document.body.appendChild(document.createTextNode(msg + '\n')); |
8 } | 8 } |
9 | 9 |
10 function runTests() | 10 function runTests() |
11 { | 11 { |
12 if (window.layoutTestController) | 12 if (window.layoutTestController) |
13 layoutTestController.dumpAsText(); | 13 layoutTestController.dumpAsText(); |
14 | 14 |
15 document.addEventListener("DOMSubtreeModified", function() { | 15 document.addEventListener("DOMSubtreeModified", function() { |
16 document.getElementById('cont').innerHTML = ''; | 16 document.getElementById('cont').innerHTML = ''; |
17 }, false); | 17 }, false); |
18 | 18 |
19 var r = document.createRange(); | 19 var r = document.createRange(); |
20 try { | 20 try { |
21 r.setStartBefore(document.getElementById('start')); | 21 r.setStartBefore(document.getElementById('start')); |
22 r.setEndAfter(document.getElementById('end')); | 22 r.setEndAfter(document.getElementById('end')); |
23 var fragment = r.extractContents(); | 23 var fragment = r.extractContents(); |
24 document.body.appendChild(fragment); | |
25 } catch(e) { | 24 } catch(e) { |
26 } | 25 } |
27 log('PASS: No crash.'); | 26 log('PASS: No crash.'); |
28 } | 27 } |
29 | 28 |
30 </script> | 29 </script> |
31 </head> | 30 </head> |
32 <body onload="runTests();"> | 31 <body onload="runTests();"> |
33 <p id="cont"> | 32 <p id="cont"> |
34 <span>This <span id="start">tests</span></span> | 33 <span>This <span id="start">tests</span></span> |
35 <span>that we don't crash when mutating the dom during</span> | 34 <span>that we don't crash when mutating the dom during</span> |
36 <span>an <code id="end">extractContents</code> call.</span> | 35 <span>an <code id="end">extractContents</code> call.</span> |
37 </p> | 36 </p> |
38 </body> | 37 </body> |
39 </html> | 38 </html> |
OLD | NEW |