2011-05-12 Ryosuke Niwa <rniwa@webkit.org>
[WebKit-https.git] / LayoutTests / editing / text-iterator / thai-cursor-movement.html
1 <html>
2 <head>
3 <meta charset="utf-8">
4 <script src="../editing.js" language="javascript" type="text/javascript"></script>
5 <script language="javascript" type="text/javascript">
6 function log(str)
7 {
8     var li = document.createElement("li");
9     li.appendChild(document.createTextNode(str));
10     var console = document.getElementById("console");
11     console.appendChild(li);
12 }
13
14 function editingTest()
15 {
16     if (window.layoutTestController)
17         layoutTestController.dumpAsText();
18     var editableArea = document.getElementById("test");
19     editableArea.focus();
20
21     var i = 1;
22     for (; i <= editableArea.firstChild.data.length; ++i) {
23         moveSelectionForwardByCharacterCommand();
24         if (getSelection().baseOffset != i) {
25             log("FAIL: " + i);
26             return;
27         }
28     }
29
30     log("PASS");
31 }
32 </script>
33 </head>
34 <body>
35 <p>Test that moving insertion point over Thai text (without ligatures) always moves one character at a time.</p>
36 <p>Should say PASS:</p>
37 <div contenteditable id="test">อยากไปความ</div>
38 <ul id="console"></ul>
39 <script language="javascript" type="text/javascript">
40 runEditingTest();
41 </script>
42 </body>
43 </html>