bug989012-2.html (827B)
1 <html class="reftest-wait"> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 4 <script src="/tests/SimpleTest/EventUtils.js"></script> 5 <style> 6 span:before { 7 content: "IMAGE"; 8 } 9 </style> 10 </head> 11 <body onload="start()"> 12 <div onfocus="setTimeout(done, 0)" contenteditable>foo<span></span>bar</div> 13 <script> 14 var div = document.querySelector("div"); 15 function start() { 16 div.focus(); 17 } 18 function done() { 19 var sel = getSelection(); 20 sel.collapse(div, 0); 21 // Press Right four times to set the caret right before "bar" 22 for (var i = 0; i < 4; ++i) { 23 synthesizeKey("KEY_ArrowRight"); 24 } 25 document.documentElement.removeAttribute("class"); 26 } 27 </script> 28 </body> 29 </html>