| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <script src="../../assert_selection.js"></script> |
| 5 <script> |
| 6 const isMac = navigator.platform.indexOf('Mac') === 0; |
| 7 |
| 8 test(() => assert_selection( |
| 9 [ |
| 10 '<div contenteditable>', |
| 11 '|foo <img src="../../resources/abe.png"> bar', |
| 12 '</div>', |
| 13 ].join(''), |
| 14 selection => selection.modify('move', 'forward', 'sentence'), |
| 15 [ |
| 16 '<div contenteditable>', |
| 17 'foo <img src="../../resources/abe.png"> bar|', |
| 18 '</div>', |
| 19 ].join('')), |
| 20 'Move forward sentence'); |
| 21 |
| 22 test(() => assert_selection( |
| 23 [ |
| 24 '<div contenteditable>', |
| 25 'foo <img src="../../resources/abe.png"> bar|', |
| 26 '</div>', |
| 27 ].join(''), |
| 28 selection => selection.modify('move', 'backward', 'sentence'), |
| 29 [ |
| 30 '<div contenteditable>', |
| 31 '|foo <img src="../../resources/abe.png"> bar', |
| 32 '</div>', |
| 33 ].join('')), |
| 34 'Move backward sentence'); |
| 35 |
| 36 test(() => assert_selection( |
| 37 [ |
| 38 '<div contenteditable>', |
| 39 '|foo<img src="../../resources/abe.png">bar baz', |
| 40 '</div>', |
| 41 ].join(''), |
| 42 selection => { |
| 43 selection.modify('move', 'forward', 'word'); |
| 44 selection.modify('move', 'forward', 'word'); |
| 45 }, |
| 46 [ |
| 47 '<div contenteditable>', |
| 48 isMac |
| 49 ? 'foo<img src="../../resources/abe.png">bar| baz' |
| 50 : 'foo<img src="../../resources/abe.png">bar |baz', |
| 51 '</div>', |
| 52 ].join('')), |
| 53 'Move forward word'); |
| 54 |
| 55 test(() => assert_selection( |
| 56 [ |
| 57 '<div contenteditable>', |
| 58 'foo bar<img src="../../resources/abe.png">baz|', |
| 59 '</div>', |
| 60 ].join(''), |
| 61 selection => { |
| 62 selection.modify('move', 'backward', 'word'); |
| 63 selection.modify('move', 'backward', 'word'); |
| 64 }, |
| 65 [ |
| 66 '<div contenteditable>', |
| 67 'foo |bar<img src="../../resources/abe.png">baz', |
| 68 '</div>', |
| 69 ].join('')), |
| 70 'Move backward word'); |
| 71 </script> |
| OLD | NEW |