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"><i>F and seven</i> years <b> as </b>our fathers f upon th
is |
| 7 continent, a new nation, conceived in Liberty, and
dedicated to the |
| 8 proposition that all |
| 9 <br>men are created equal.</span> |
| 10 </div> |
| 11 <div id="log"></div> |
| 12 <script> |
| 13 test(function() { |
| 14 var selection = window.getSelection(); |
| 15 selection.collapse(sample, 0); |
| 16 for (i = 0; i < 159; ++i) |
| 17 selection.modify('move', 'forward', 'character'); |
| 18 for (i = 0; i < 158; ++i) |
| 19 selection.modify('move', 'backward', 'character'); |
| 20 assert_true(selection.isCollapsed, 'isCollapsed'); |
| 21 assert_equals(selection.anchorNode, sample.firstChild.firstChild, 'anchorNod
e'); |
| 22 assert_equals(selection.anchorOffset, 1, 'anchorOffset'); |
| 23 }); |
| 24 </script> |
| 25 |
| 26 </body> |
OLD | NEW |