|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=565392 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 998188</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=998188">Mozilla Bug 998188</a> |
|
14 <p id="display"></p> |
|
15 <div id="content" style="display: none"> |
|
16 |
|
17 </div> |
|
18 <div id="editor" contenteditable>abc</div> |
|
19 <pre id="test"> |
|
20 <script type="application/javascript"> |
|
21 |
|
22 /** Test for Bug 998188 **/ |
|
23 |
|
24 SimpleTest.waitForExplicitFinish(); |
|
25 |
|
26 function runTests() |
|
27 { |
|
28 var editor = document.getElementById("editor"); |
|
29 editor.focus(); |
|
30 |
|
31 var textNode1 = document.createTextNode("def"); |
|
32 var textNode2 = document.createTextNode("ghi"); |
|
33 |
|
34 editor.appendChild(textNode1); |
|
35 editor.appendChild(textNode2); |
|
36 |
|
37 window.getSelection().collapse(textNode2, 3); |
|
38 |
|
39 for (var i = 0; i < 9; i++) { |
|
40 var caretRect = synthesizeQueryCaretRect(i); |
|
41 ok(caretRect.succeeded, "QueryCaretRect should succeeded (" + i + ")"); |
|
42 } |
|
43 |
|
44 SimpleTest.finish(); |
|
45 } |
|
46 |
|
47 SimpleTest.waitForFocus(runTests); |
|
48 |
|
49 </script> |
|
50 </pre> |
|
51 </body> |
|
52 </html> |