bug512295-1-ref.html (837B)
1 <!DOCTYPE HTML><html class="reftest-wait"><head> 2 <script src="/tests/SimpleTest/EventUtils.js"></script> 3 </head> 4 <body> 5 <div contenteditable="true"> 6 <p id="p">A B CD EFG<br> 7 1234567890</p> 8 </div> 9 x 10 <script> 11 // Position the caret at the end of the P element 12 var p = document.getElementById('p'); 13 var div = p.parentNode; 14 div.focus(); 15 var { maybeOnSpellCheck } = SpecialPowers.ChromeUtils.importESModule( 16 "resource://testing-common/AsyncSpellCheckTestHelper.sys.mjs" 17 ); 18 maybeOnSpellCheck(div, function () { 19 var sel = window.getSelection(); 20 sel.removeAllRanges(); 21 var range = document.createRange(); 22 range.setStart(p, p.childNodes.length); 23 range.setEnd(p, p.childNodes.length); 24 sel.addRange(range); 25 document.documentElement.classList.remove("reftest-wait"); 26 }); 27 </script> 28 29 </body> 30 </html>