Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / deleting / delete-inline-br.html
blob9588417c5f1f4a22eb8e1ab74267d4016bfb5273
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 the 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="../../resources/js-test.js"></script>
14 <script>
15 description('Testcase for verifying that the &lt;br&gt; does not get deleted when inlined after some non-textual content.');
16 function $(id) { return document.getElementById(id); }
18 function absoluteCaretBounds(node) {
19 return window.internals ? internals.absoluteCaretBounds(node) : '';
22 var selection = window.getSelection();
23 selection.collapse($('sample'), 2);
24 var expectedCaretRect = absoluteCaretBounds(document);
26 selection.collapse($('sample'), 3);
27 document.execCommand('Delete');
28 var caretRect = absoluteCaretBounds(document);
30 shouldBe('caretRect.left', 'expectedCaretRect.left');
31 shouldBe('caretRect.top', 'expectedCaretRect.top');
33 if (window.testRunner)
34 $('container').outerHTML = '';
35 </script>
36 <script src="../../resources/js-test.js"></script>