Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <!DOCTYPE html> |
|
yosin_UTC9
2016/03/17 04:25:41
Could you move them into editing/selection/modify_
| |
| 2 <head> | 2 <script src="../../resources/testharness.js"></script> |
| 3 | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> | |
| 5 .editing { | |
| 6 border: 2px solid red; | |
| 7 padding: 12px; | |
| 8 font-size: 24px; | |
| 9 } | |
| 10 </style> | |
| 11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > | |
| 12 | |
| 13 <script> | |
| 14 | |
| 15 function editingTest() { | |
| 16 moveSelectionForwardByCharacterCommand(); | |
| 17 moveSelectionForwardByCharacterCommand(); | |
| 18 for (i = 0; i < 7; i++) { | |
| 19 extendSelectionForwardByCharacterCommand(); | |
| 20 } | |
| 21 } | |
| 22 | |
| 23 </script> | |
| 24 | |
| 25 <title>Editing Test</title> | |
| 26 </head> | |
| 27 <body> | 4 <body> |
| 28 <div contenteditable id="root" class="editing"> | 5 <div contenteditable id="root" class="editing"> |
| 29 <span id="test">f oo bar baz</span> | 6 <span id="span">f oo bar baz</span> |
| 30 </div> | 7 </div> |
| 31 | 8 <div id="log"></div> |
| 32 <script> | 9 <script> |
| 33 runEditingTest(); | 10 test(function () { |
| 11 var selection = getSelection(); | |
| 12 selection.collapse(span.firstChild, 0); | |
| 13 selection.modify("move", "forward", "character"); | |
| 14 selection.modify("move", "forward", "character"); | |
| 15 for (i = 0; i < 7; i++) { | |
| 16 selection.modify("extend", "forward", "character"); | |
| 17 } | |
| 18 assert_equals(selection.toString(), "oo bar "); | |
| 19 }); | |
| 34 </script> | 20 </script> |
| 35 | 21 |
| 36 </body> | 22 </body> |
| 37 </html> | |
| OLD | NEW |