| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 5 <div id="root"> | 5 <div id="root"> |
| 6 <div id="targetForSurround"></div> | 6 <div id="targetForSurround"></div> |
| 7 <div id="description">Test that there is no crash when surroundContents is
called with a node preceding the current selection.</div> | 7 <div id="description">Test that there is no crash when surroundContents is
called with a node preceding the current selection.</div> |
| 8 <div id="trailingNode"></div> | 8 <div id="trailingNode"></div> |
| 9 </div> | 9 </div> |
| 10 <script> | 10 <script> |
| 11 var range = document.createRange(); | 11 var range = document.createRange(); |
| 12 var rootNode = document.getElementById("root"); | 12 var rootNode = document.getElementById("root"); |
| 13 range.setStart(rootNode, 4); | 13 range.setStart(rootNode, 4); |
| 14 range.setEnd(rootNode, 6); | 14 range.setEnd(rootNode, 6); |
| 15 var parentElement = document.getElementById("targetForSurround"); | 15 var parentElement = document.getElementById("targetForSurround"); |
| 16 range.surroundContents(parentElement); | 16 range.surroundContents(parentElement); |
| 17 | 17 |
| 18 shouldBe('range.startContainer.id', 'rootNode.id'); | 18 shouldBe('range.startContainer.id', 'rootNode.id'); |
| 19 shouldBe('range.startOffset', '3'); | 19 shouldBe('range.startOffset', '3'); |
| 20 shouldBe('range.endContainer.id', 'rootNode.id'); | 20 shouldBe('range.endContainer.id', 'rootNode.id'); |
| 21 shouldBe('range.startOffset', '3'); | 21 shouldBe('range.startOffset', '3'); |
| 22 </script> | 22 </script> |
| 23 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 24 </body> | 23 </body> |
| 25 </html> | 24 </html> |
| OLD | NEW |