caret_on_presshell_reinit-2.html (884B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <body> 4 <iframe srcdoc="<body><div></div></body>"></iframe> 5 <script type="text/javascript"> 6 onload = function() { 7 var i = document.querySelector("iframe"); 8 var win = i.contentWindow; 9 var doc = win.document; 10 var div = doc.querySelector("div"); 11 win.getSelection().collapse(div, 0); 12 i.focus(); 13 div.contentEditable = true; 14 div.focus(); 15 setTimeout(function() { 16 var span = doc.createElement("span"); 17 span.appendChild(doc.createTextNode("foo")); 18 div.appendChild(span); 19 div.style.outline = "none"; // remove the focus outline 20 i.style.position = "absolute"; 21 document.body.clientWidth; 22 document.documentElement.removeAttribute("class"); 23 }, 0); 24 }; 25 </script> 26 </body> 27 </html>