OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <meta charset="utf-8"> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <meta http-equiv="content-type" content="text/html; charset=utf-8"> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <style> .selected { color: blue; } </style> | |
6 </head> | |
7 <body> | |
8 <p>This tests horizontal caret movement in vertical writing mode.</p> | 5 <p>This tests horizontal caret movement in vertical writing mode.</p> |
9 <div id="test" style="font-family: monospace; font-size: 20px; height: 15ex; -we
bkit-writing-mode: vertical-rl;-webkit-text-orientation:sideways-right;text-rend
ering:optimizeLegibility; outline: none;" contenteditable> | 6 <div id="test" style="font-family: monospace; font-size: 20px; height: 15ex; -we
bkit-writing-mode: vertical-rl;-webkit-text-orientation:sideways-right;text-rend
ering:optimizeLegibility; outline: none;" contenteditable> |
10 <p dir="rtl">אני חתול.</p><p dir="rtl">אין לי שם.</p> | 7 <p id="p1" dir="rtl">אני חתול.</p><p id="p2" dir="rtl">אין לי שם.</p> |
11 </div> | 8 </div> |
12 <pre id="log"></pre> | 9 <div id="log"></div> |
13 <script> | 10 <script> |
| 11 test(function() { |
| 12 var selection = window.getSelection(); |
| 13 var p1 = document.getElementById('p1'); |
| 14 var p2 = document.getElementById('p2'); |
| 15 selection.collapse(p2.firstChild, 5); |
| 16 selection.modify('Extend', 'Backward', 'Line'); |
14 | 17 |
15 var test = document.getElementById('test'); | 18 assert_false(selection.isCollapsed, 'isCollapsed'); |
16 window.getSelection().collapse(test.getElementsByTagName('p')[1].lastChild, 5); | 19 assert_equals(selection.anchorNode, p2.firstChild, 'anchorNode'); |
17 window.getSelection().modify('Extend', 'Backward', 'Line'); | 20 assert_equals(selection.anchorOffset, 5, 'anchorOffset'); |
18 | 21 assert_equals(selection.focusNode, p1.firstChild, 'focusNode'); |
| 22 assert_equals(selection.focusOffset, 5, 'focusOffset'); |
| 23 }); |
19 </script> | 24 </script> |
20 </body> | |
21 </html> | |
OLD | NEW |