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 <div id="span">foo<span class="Apple-tab-span" style="white-space:pre"> </span>b
ar</div> |
| 7 </div> |
| 8 <div id="log"></div> |
| 9 |
| 10 <script> |
| 11 test(function () { |
| 12 var selection = getSelection(); |
| 13 selection.collapse(span.firstChild, 0); |
| 14 for (i = 0; i < 4; i++) { |
| 15 selection.modify("move", "forward", "character"); |
| 16 } |
| 17 selection.modify("extend", "forward", "word"); |
| 18 assert_equals(selection.anchorNode, span.childNodes[2]); |
| 19 assert_equals(selection.anchorOffset, 0); |
| 20 assert_equals(selection.focusNode, span.childNodes[2]); |
| 21 assert_equals(selection.focusOffset, 3); |
| 22 }); |
| 23 </script> |
| 24 |
| 25 </body> |
OLD | NEW |