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="sample">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 = window.getSelection(); |
| 14 selection.collapse(sample, 0); |
| 15 for (i = 0; i < 33; ++i) |
| 16 selection.modify('move', 'forward', 'character'); |
| 17 for (i = 0; i < 32; ++i) |
| 18 selection.modify('move', 'backward', 'character'); |
| 19 assert_true(selection.isCollapsed, 'isCollapsed'); |
| 20 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode'); |
| 21 assert_equals(selection.anchorOffset, 1, 'anchorOffset'); |
| 22 }); |
| 23 </script> |
| 24 |
| 25 </body> |
OLD | NEW |