Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML><html class="reftest-wait"><head> |
michael@0 | 2 | <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 3 | </head> |
michael@0 | 4 | <body> |
michael@0 | 5 | <div contenteditable="true"> |
michael@0 | 6 | <p id="p">A B CD EFG<br> |
michael@0 | 7 | 1234567890</p> |
michael@0 | 8 | </div> |
michael@0 | 9 | x |
michael@0 | 10 | <script> |
michael@0 | 11 | // Position the caret at the end of the P element |
michael@0 | 12 | var p = document.getElementById('p'); |
michael@0 | 13 | var div = p.parentNode; |
michael@0 | 14 | div.focus(); |
michael@0 | 15 | SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window); |
michael@0 | 16 | onSpellCheck(div, function () { |
michael@0 | 17 | var sel = window.getSelection(); |
michael@0 | 18 | sel.removeAllRanges(); |
michael@0 | 19 | var range = document.createRange(); |
michael@0 | 20 | range.setStart(p, p.childNodes.length); |
michael@0 | 21 | range.setEnd(p, p.childNodes.length); |
michael@0 | 22 | sel.addRange(range); |
michael@0 | 23 | document.documentElement.classList.remove("reftest-wait"); |
michael@0 | 24 | }); |
michael@0 | 25 | </script> |
michael@0 | 26 | |
michael@0 | 27 | </body> |
michael@0 | 28 | </html> |