OLD | NEW |
(Empty) | |
| 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>t
ext2</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 b
eginning of that line.'); |
| 15 |
| 16 Markup.waitUntilDone(); |
| 17 |
| 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); |
| 24 |
| 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); |
| 31 |
| 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); |
| 38 |
| 39 Markup.notifyDone(); |
| 40 </script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |