blob: 9588417c5f1f4a22eb8e1ab74267d4016bfb5273 [file] [log] [blame]
<div id="container">
<p id="description"></p>
<ol>
<li>Place the caret at the start of the second line</li>
<li>Hit Baskspace or Delete to a back-delete</li>
<li>The two lines should then be merged and the caret should get placed after the text control.</li>
</ol>
<div contenteditable="true">
<span id="sample">text1<input type="text"/><br>text2</span>
</div>
</div>
<div id="console"></div>
<script src="../../resources/js-test.js"></script>
<script>
description('Testcase for verifying that the &lt;br&gt; does not get deleted when inlined after some non-textual content.');
function $(id) { return document.getElementById(id); }
function absoluteCaretBounds(node) {
return window.internals ? internals.absoluteCaretBounds(node) : '';
}
var selection = window.getSelection();
selection.collapse($('sample'), 2);
var expectedCaretRect = absoluteCaretBounds(document);
selection.collapse($('sample'), 3);
document.execCommand('Delete');
var caretRect = absoluteCaretBounds(document);
shouldBe('caretRect.left', 'expectedCaretRect.left');
shouldBe('caretRect.top', 'expectedCaretRect.top');
if (window.testRunner)
$('container').outerHTML = '';
</script>
<script src="../../resources/js-test.js"></script>