OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <style> |
| 4 #target { |
| 5 display: grid; |
| 6 display: -webkit-grid; |
| 7 } |
| 8 </style> |
| 9 <div id="target" contentEditable>T</div> |
| 10 <script> |
| 11 var targetDiv = document.getElementById('target'); |
| 12 targetDiv.focus(); |
| 13 |
| 14 // Move cursor to the end of line. |
| 15 getSelection().modify('move', 'forward', 'lineboundary'); |
| 16 |
| 17 document.execCommand("insertText", false, "EST"); |
| 18 shouldBeEqualToString("targetDiv.innerText", "TEST"); |
| 19 |
| 20 document.execCommand("delete"); |
| 21 document.execCommand("delete"); |
| 22 document.execCommand("delete"); |
| 23 document.execCommand("delete"); |
| 24 shouldBeEmptyString("targetDiv.innerText"); |
| 25 |
| 26 document.execCommand("insertText", false, "TEST"); |
| 27 shouldBeEqualToString("targetDiv.innerText", "TEST"); |
| 28 </script> |
OLD | NEW |