Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / insert-paragraph-after-non-editable-node-before-text.html
blobb368ee643a5e20867f1e1b410596234785ab7a86
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/dump-as-markup.js"></script>
5 <div contenteditable="true">
6 <span id="imgTest">text1<img src="abe.png"/>text2</span>
7 <br>
8 <span id="inputTest">text1<input type="text"></input>text2</span>
9 <br>
10 <span id="objectTest">text1<object style="display: inline" border="1"></object>text2</span>
11 </div>
12 <script>
13 Markup.description('Testcase for bug https://webkit.org/b/115023: Editing: wrong text position when you click enter on the text behind the image.\n'+
14 'The test passes if "text2" appears on a new line with the caret placed at the beginning of that line.');
16 Markup.waitUntilDone();
18 var test = document.getElementById('imgTest');
19 test.focus();
20 var selection = window.getSelection();
21 selection.collapse(test, test.childNodes.length - 1);
22 document.execCommand("InsertParagraph");
23 Markup.dump(test);
25 test = document.getElementById('inputTest');
26 test.focus();
27 selection = window.getSelection();
28 selection.collapse(test, test.childNodes.length - 1);
29 document.execCommand("InsertParagraph");
30 Markup.dump(test);
32 test = document.getElementById('objectTest');
33 test.focus();
34 selection = window.getSelection();
35 selection.collapse(test, test.childNodes.length - 1);
36 document.execCommand("InsertParagraph");
37 Markup.dump(test);
39 Markup.notifyDone();
40 </script>
41 </body>
42 </html>