bug1263357-1.html (916B)
1 <!DOCTYPE HTML><html> 2 <!-- 3 https://bugzilla.mozilla.org/show_bug.cgi?id=bug1263357 4 --> 5 <head> 6 <meta charset="utf-8"> 7 <title>Testcase #1 for bug1263357</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 </head> 11 <body> 12 <div id="editable" contenteditable='true' spellcheck=false style="outline: 1px solid;"><p><tt>xyz</tt><br></p></div> 13 <script> 14 15 function start() { 16 var sel = window.getSelection(); 17 // Focus on editable block. 18 theDiv = document.getElementById("editable"); 19 theDiv.focus(); 20 sel.collapse(theDiv, 0); 21 if (navigator.platform.indexOf("Win") == 0) { 22 synthesizeKey("KEY_End"); 23 } else { 24 // End key doesn't work as expected on Mac and Linux. 25 sel.modify("move", "right", "lineboundary"); 26 } 27 synthesizeKey("KEY_Enter", {shiftKey: true}); 28 } 29 30 SimpleTest.waitForFocus(start); 31 32 </script> 33 </body> 34 </html>