OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <style> |
| 4 div { |
| 5 border: 2px solid red; |
| 6 padding: 12px; |
| 7 line-height: 1.66666667; |
| 8 width: 70px; |
| 9 } |
| 10 </style> |
| 11 <script src="../../resources/testharness.js"></script> |
| 12 <script src="../../resources/testharnessreport.js"></script> |
| 13 </head> |
| 14 <body> |
| 15 <div contenteditable id="editor"> |
| 16 The caret |
| 17 <span id="line2"> height should be the same for each line.</span> |
| 18 </div> |
| 19 <script> |
| 20 test(function () { |
| 21 var editor = document.getElementById('editor'); |
| 22 editor.focus(); |
| 23 |
| 24 var caretHeight1 = window.internals.absoluteCaretBounds().height; |
| 25 var sel = window.getSelection(); |
| 26 sel.collapse(line2, 0); |
| 27 var caretHeight2 = window.internals.absoluteCaretBounds().height; |
| 28 |
| 29 assert_equals(caretHeight1, caretHeight2, 'The caret height is the same for ea
ch line.'); |
| 30 }, 'Compare the caret height'); |
| 31 </script> |
| 32 </body> |
| 33 </html> |
| 34 |
OLD | NEW |