<html>
<head>
<meta charset="utf-8">
<script src="../editing.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function log(str)
{
    var li = document.createElement("li");
    li.appendChild(document.createTextNode(str));
    var console = document.getElementById("console");
    console.appendChild(li);
}

function editingTest()
{
    if (window.testRunner)
        testRunner.dumpAsText();
    var editableArea = document.getElementById("test");
    editableArea.focus();

    var i = 1;
    for (; i <= editableArea.firstChild.data.length; ++i) {
        moveSelectionForwardByCharacterCommand();
        if (getSelection().baseOffset != i) {
            log("FAIL: " + i);
            return;
        }
    }

    log("PASS");
}
</script>
</head>
<body>
<p>Test that moving insertion point over Thai text (without ligatures) always moves one character at a time.</p>
<p>Should say PASS:</p>
<div contenteditable id="test">อยากไปความ</div>
<ul id="console"></ul>
<script language="javascript" type="text/javascript">
runEditingTest();
</script>
</body>
</html>
