OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <body> |
| 5 <div contenteditable id="root" class="editing"> |
| 6 <span id="span">a<img src="../../resources/abe.png">new |
| 7 <br>nation <i> </i> <img src="../../resources/abe.png"> conceived |
| 8 <br>nation<img src="../../resources/abe.png"></span> |
| 9 </div> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 test(function () { |
| 13 var selection = getSelection(); |
| 14 selection.collapse(span.firstChild, 0); |
| 15 for (i = 0; i < 33; i++) { |
| 16 selection.modify("extend", "forward", "character"); |
| 17 } |
| 18 for (i = 0; i < 30; i++) { |
| 19 selection.modify("extend", "backward", "character"); |
| 20 } |
| 21 assert_equals(selection.anchorNode, span.firstChild); |
| 22 assert_equals(selection.anchorOffset, 0); |
| 23 assert_equals(selection.focusNode, span.childNodes[2]); |
| 24 assert_equals(selection.focusOffset, 1); |
| 25 }); |
| 26 </script> |
| 27 </body> |
OLD | NEW |