tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / platform / chromium-cg-mac / editing / input / ime-candidate-window-position.html
1 <html>
2 <head>
3 <style>
4 * {
5     padding: 0px;
6     margin: 0px;
7     border: 0px;
8 }
9 </style>
10 <script src="../../../../fast/js/resources/js-test-pre.js"></script>
11 <script>
12 window.jsTestIsAsync = true;
13
14 function doTest() {
15     if (window.layoutTestController) {
16         frame = document.getElementsByTagName('iframe')[0];
17         input = frames['iframe'].document.getElementsByTagName('input')[0];
18         input.focus();
19         rect = textInputController.firstRectForCharacterRange(0, 0);
20         debug('rect[0] denotes x coodinate and rect[1] denotes y coodinate');
21         // I'm not sure why we need to +1 for x coodinate here but
22         // firstRectForCharacterRange returns that value.
23         shouldBe('rect[0]', 'frame.offsetLeft + input.offsetLeft + 1');
24         shouldBe('rect[1]', 'frame.offsetTop + input.offsetTop');
25     }
26     finishJSTest();
27 }
28 </script>
29 </head>
30 <body>
31 <div>
32 This test ensures that the IME candidate window appears at the appropriate position.  Enter some text with IME in the following gray box and convert them.  Then check whether the candidate window appears the below of the composition text.  In DRT, this test checks it by calling textInputController.firstRectForCharacterRange().
33 </div>
34 <div id="console"></div>
35 <iframe name="iframe" style="position: absolute; top: 200px; left: 200px;" src="../resources/ime-candidate-window-position-iframe.html" width="300" height="300" onload="doTest()">
36 </iframe>
37 <script src="../../../../fast/js/resources/js-test-post.js"></script>
38 </body>
39 </html>