| 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. "ある。" and "名前は
まだ" must be selected.</p> | 5 <p>This tests horizontal caret movement in vertical writing mode. "ある。" and "名前は
まだ" must be selected.</p> |
| 9 <div id="test" style="-webkit-writing-mode: vertical-rl; outline: none;" content
editable> | 6 <div id="test" style="-webkit-writing-mode: vertical-rl; outline: none;" content
editable> |
| 10 <p>吾輩は猫である。名前はまだ無い。</p> | 7 <p id="p1">吾輩は猫である。名前はまだ無い。</p> |
| 11 </div> | 8 </div> |
| 12 | |
| 13 <span id="span-for-height-calc" style="-webkit-writing-mode: vertical-rl; outlin
e: none;"> | 9 <span id="span-for-height-calc" style="-webkit-writing-mode: vertical-rl; outlin
e: none;"> |
| 14 <p>吾輩は猫である。<br>名前はまだ無い。</p> | 10 <p>吾輩は猫である。<br>名前はまだ無い。</p> |
| 15 </span> | 11 </span> |
| 16 <pre id="log"></pre> | 12 <div id="log"></div> |
| 17 <script> | 13 <script> |
| 14 test(function() { |
| 15 var desiredHeight = document.getElementById('span-for-height-calc'); |
| 16 var test = document.getElementById('test'); |
| 17 test.style.height = (desiredHeight.offsetHeight + 2) + 'px'; |
| 18 desiredHeight.style.display = 'none'; |
| 18 | 19 |
| 19 var desiredHeight = document.getElementById('span-for-height-calc'); | 20 var selection = window.getSelection(); |
| 20 var test = document.getElementById('test'); | 21 var p1 = document.getElementById('p1'); |
| 21 test.style.height = (desiredHeight.offsetHeight + 2) + 'px'; | 22 selection.collapse(p1.firstChild, 13); |
| 22 desiredHeight.style.display = 'none'; | 23 selection.modify('Extend', 'Backward', 'Line'); |
| 23 | 24 |
| 24 window.getSelection().collapse(test.getElementsByTagName('p')[0].firstChild, 13)
; | 25 assert_false(selection.isCollapsed, 'isCollapsed'); |
| 25 window.getSelection().modify('Extend', 'Backward', 'Line'); | 26 assert_equals(selection.anchorNode, p1.firstChild, 'anchorNode'); |
| 26 | 27 assert_equals(selection.anchorOffset, 13, 'anchorOffset'); |
| 28 assert_equals(selection.focusNode, p1.firstChild, 'focusNode'); |
| 29 assert_equals(selection.focusOffset, 5, 'focusOffset'); |
| 30 }); |
| 27 </script> | 31 </script> |
| 28 </body> | |
| 29 </html> | |
| OLD | NEW |