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