Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
|
rune
2015/02/26 10:38:50
html, head, and body should be left out when not n
changseok
2015/02/26 11:28:54
Done.
| |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 <style> | |
| 6 #target { | |
| 7 display: grid; | |
| 8 display: -webkit-grid; | |
| 9 } | |
| 10 </style> | |
| 11 <script> | |
| 12 var targetDiv; | |
| 13 function test() | |
| 14 { | |
| 15 targetDiv = document.getElementById('target'); | |
| 16 targetDiv.focus(); | |
| 17 | |
| 18 // Move cursor to the end of line. | |
| 19 getSelection().modify('move', 'forward', 'lineboundary'); | |
| 20 | |
| 21 document.execCommand("insertText", false, "EST"); | |
| 22 shouldBeEqualToString("targetDiv.innerText", "TEST"); | |
| 23 | |
| 24 document.execCommand("delete"); | |
| 25 document.execCommand("delete"); | |
| 26 document.execCommand("delete"); | |
| 27 document.execCommand("delete"); | |
| 28 shouldBeEmptyString("targetDiv.innerText"); | |
| 29 | |
| 30 document.execCommand("insertText", false, "TEST"); | |
| 31 shouldBeEqualToString("targetDiv.innerText", "TEST"); | |
| 32 } | |
|
rune
2015/02/26 10:38:50
You shouldn't need to wait for an onload here? Cou
changseok
2015/02/26 11:28:54
You're right. Done.
| |
| 33 </script> | |
| 34 </head> | |
| 35 <body onload="test()"> | |
| 36 <div id="target" contentEditable>T</div> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |