OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <div style="width: 6ex;" contenteditable=true> | 4 <div style="width: 6ex;" contenteditable=true> |
5 <div>hello world</div><div><br></div> | 5 <div>hello world</div><div><br></div> |
6 </div> | 6 </div> |
7 <script src="../../resources/dump-as-markup.js"></script> | 7 <script src="../../resources/dump-as-markup.js"></script> |
8 <script> | 8 <script> |
9 | 9 |
10 Markup.description('This test moves up caret into a wrapped line. \n' | 10 Markup.description('This test moves up caret into a wrapped line. \n' |
11 + 'i.e. the caret is moved from the empty line below "hello world" to before "w
orld".'); | 11 + 'i.e. the caret is moved from the empty line below "hello world" to before "w
orld".'); |
12 | 12 |
13 var div = document.getElementsByTagName('div')[0]; | 13 var div = document.getElementsByTagName('div')[0]; |
14 div.focus(); | 14 div.focus(); |
15 getSelection().setPosition(div, div.childNodes.length); | 15 getSelection().setPosition(div, div.childNodes.length); |
16 getSelection().modify('move', 'backward', 'line'); | 16 getSelection().modify('move', 'backward', 'line'); |
17 | 17 |
18 Markup.dump(div); | 18 Markup.dump(div); |
19 | 19 |
20 </script> | 20 </script> |
21 </body> | 21 </body> |
22 </html> | 22 </html> |
OLD | NEW |