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