| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 if (window.testRunner) | 2 if (window.testRunner) |
| 3 testRunner.dumpEditingCallbacks(); | 3 testRunner.dumpEditingCallbacks(); |
| 4 </script> | 4 </script> |
| 5 <p>Only the line break after the image should be selected.</p> | 5 <p>Only the line break after the image should be selected.</p> |
| 6 <hr> | 6 <hr> |
| 7 <div contenteditable="true" id="div"><img src="../resources/abe.png"><br>foo</di
v> | 7 <div contenteditable="true" id="div"><img src="../resources/abe.png"><br>foo</di
v> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 if (window.testRunner) | 10 if (window.testRunner) |
| 11 window.testRunner.dumpSelectionRect(); | 11 window.testRunner.dumpSelectionRect(); |
| 12 | 12 |
| 13 var e = document.getElementById("div"); | 13 // We should wait for loading IMG otherwise we can't place a caret since, |
| 14 var s = window.getSelection(); | 14 // IMG dimension is zero. |
| 15 // Select the line break | 15 window.onload = function() { |
| 16 s.setBaseAndExtent(e, 1, e, 2); | 16 var e = document.getElementById("div"); |
| 17 var s = window.getSelection(); |
| 18 // Select the line break |
| 19 s.setBaseAndExtent(e, 1, e, 2); |
| 20 }; |
| 17 </script> | 21 </script> |
| OLD | NEW |