OLD | NEW |
(Empty) | |
| 1 <div id="container"> |
| 2 <p id="description"></p> |
| 3 <ol> |
| 4 <li>Place the caret at the start of the second line</li> |
| 5 <li>Hit Baskspace or Delete to a back-delete</li> |
| 6 <li>The two lines should then be merged and the caret should get placed after th
e text control.</li> |
| 7 </ol> |
| 8 <div contenteditable="true"> |
| 9 <span id="sample">text1<input type="text"/><br>text2</span> |
| 10 </div> |
| 11 </div> |
| 12 <div id="console"></div> |
| 13 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 14 <script> |
| 15 description('Testcase for verifying that the <br> does not get deleted whe
n inlined after some non-textual content.'); |
| 16 function $(id) { return document.getElementById(id); } |
| 17 |
| 18 function absoluteCaretBounds(node) { |
| 19 return window.internals ? internals.absoluteCaretBounds(node) : ''; |
| 20 } |
| 21 |
| 22 var selection = window.getSelection(); |
| 23 selection.collapse(('sample'), 2); |
| 24 var expectedCaretRect = absoluteCaretBounds(document); |
| 25 |
| 26 selection.collapse(('sample'), 3); |
| 27 document.execCommand("Delete"); |
| 28 var caretRect = absoluteCaretBounds(document); |
| 29 |
| 30 shouldBe("caretRect.left", "expectedCaretRect.left"); |
| 31 shouldBe("caretRect.top", "expectedCaretRect.top"); |
| 32 |
| 33 if (window.testRunner) |
| 34 $('container').outerHTML = ''; |
| 35 </script> |
| 36 <script src="../../fast/js/resources/js-test-pre.js"></script> |
OLD | NEW |