bug1109968-2.html (755B)
1 <html class="reftest-wait"> 2 <head> 3 <script src="/tests/SimpleTest/EventUtils.js"></script> 4 </head> 5 <body onload="start()"> 6 <div onfocus="setTimeout(done, 0)" contenteditable>foo<div contenteditable="false"><img src="image_rgrg-256x256.png" width="10" height="10"></div>bar</div> 7 <script> 8 var div = document.querySelector("div"); 9 function start() { 10 div.focus(); 11 } 12 function done() { 13 var sel = getSelection(); 14 sel.collapse(div, 0); 15 // Press Right four times to set the caret right before "bar" 16 for (var i = 0; i < 4; ++i) { 17 synthesizeKey("KEY_ArrowRight"); 18 } 19 document.documentElement.removeAttribute("class"); 20 } 21 </script> 22 </body> 23 </html>