Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
| 5 <script> | |
| 6 window.onload = function(){ | |
| 7 var range = document.createRange(); | |
| 8 var rootNode = document.getElementById("root"); | |
| 9 range.setStart(rootNode, 4); | |
| 10 range.setEnd(rootNode, 6); | |
| 11 var parentElement = document.getElementById("targetForSurround"); | |
| 12 range.surroundContents(parentElement); | |
| 13 | |
| 14 shouldBe(range.startContainer.id, rootNode.id); | |
| 15 shouldBe(range.startOffset.toString(), "3"); | |
|
yosin_UTC9
2013/10/04 01:26:36
nit: It is better to write shouldBe('range.startOf
| |
| 16 shouldBe(range.endContainer.id, rootNode.id); | |
| 17 shouldBe(range.startOffset.toString(), "3"); | |
| 18 }; | |
| 19 </script> | |
| 20 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 21 <div id="root"> | |
| 22 <div id="targetForSurround"></div> | |
| 23 <div id="description">Test that there is no crash when surroundContents is called with a node preceding the current selection.</div> | |
| 24 <div id="trailingNode"></div> | |
| 25 </div> | |
| 26 </body> | |
| 27 </html> | |
| OLD | NEW |