OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <title>Check caret position inside empty cell</title> |
| 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> |
| 5 <link rel="match" href="caret-in-empty-cell-expected.html"> |
| 6 <style> |
| 7 table { |
| 8 font-size: 2em; |
| 9 } |
| 10 td { |
| 11 padding: 5px; |
| 12 } |
| 13 #emptycell { |
| 14 width: 50%; |
| 15 } |
| 16 </style> |
| 17 |
| 18 <p>Test passes if the caret in the empty cell is inside the cell itself (that me
ans it's vertically aligned with the reference text).</p> |
| 19 |
| 20 <table border="1" contenteditable> |
| 21 <td>Reference text</td> |
| 22 <td id="emptycell"></td> |
| 23 </table> |
| 24 |
| 25 <script> |
| 26 var selection = window.getSelection(); |
| 27 var emptycell = document.getElementById("emptycell"); |
| 28 selection.collapse(emptycell, 0); |
| 29 </script> |
OLD | NEW |