OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 div { border: 1px solid black; } |
| 6 </style> |
| 7 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 8 <script> |
| 9 function runTest() { |
| 10 description('Testcase for verifying that the <br> does not get deleted
when inlined after some non-textual content.\nTo manually verify this issue, pl
ace the caret at the start of the second line and then do a back-delete (backspa
ce). The two lines should then be merged and the caret should get placed after t
he text control.'); |
| 11 |
| 12 if (window.internals) { |
| 13 var selection = window.getSelection(); |
| 14 var testElement = document.getElementById('test'); |
| 15 |
| 16 selection.collapse(testElement, 2); |
| 17 expectedCaretRect = internals.absoluteCaretBounds(document); |
| 18 |
| 19 selection.collapse(testElement, 3); |
| 20 document.execCommand("Delete"); |
| 21 caretRect = internals.absoluteCaretBounds(document); |
| 22 |
| 23 shouldBe("caretRect.left", "expectedCaretRect.left"); |
| 24 shouldBe("caretRect.top", "expectedCaretRect.top"); |
| 25 |
| 26 testElement.style.display = 'none'; |
| 27 } |
| 28 } |
| 29 </script> |
| 30 <body onLoad="runTest()"> |
| 31 <div contenteditable="true"> |
| 32 <span id="test">text1<input type="text"/><br>text2</span> |
| 33 </div> |
| 34 <div id="description"></div> |
| 35 <div id="console"></div> |
| 36 </body> |
| 37 </html> |
OLD | NEW |