no bug - Import translations from android-l10n r=release a=l10n CLOSED TREE
[gecko.git] / layout / base / tests / bug585922.html
blob4f4eaeb6b9330b191944d1453a84db8f9e538e79
1 <!DOCTYPE html>
2 <html class="reftest-wait">
3 <head>
4 <script src="/tests/SimpleTest/EventUtils.js"></script>
5 </head>
6 <body onload="doTest()">
7 <input type=text style="-moz-appearance: none">
8 <script>
9 function doTest() {
10 function enableCaret(aEnable) {
11 var selCon = editor.selectionController;
12 selCon.setCaretEnabled(aEnable);
15 var d = document.querySelector("input");
16 d.value = "a";
17 d.focus();
18 var editor = SpecialPowers.wrap(d).editor;
19 var sel = editor.selection;
20 var t = editor.rootElement.firstChild;
21 sel.collapse(t, 1); // put the caret at the end of the div
22 setTimeout(function() {
23 enableCaret(false);enableCaret(true);// force a caret display
24 enableCaret(false); // hide the caret
25 t.replaceData(0, 1, "b"); // replace the text node data
26 // at this point, the selection is collapsed to offset 0
27 synthesizeQuerySelectedText(); // call nsCaret::GetGeometry
28 sel.collapse(t, 1); // put the caret at the end again
29 enableCaret(true); // show the caret again
30 document.documentElement.removeAttribute("class");
31 }, 0);
33 </script>
34 </body>
35 </html>