<!DOCTYPE html>
<html>
<body>
This test sets caret at the beginning of backward text and moving the character to left and right.  WebKit should not crash and you should see PASS below:
<textarea id="editor">&#8238;LTR
</textarea>
<script>
onload = function() {
    var sel = window.getSelection();
    sel.empty();
    var test = document.getElementById("editor");
    test.focus();
    test.selectionDirection = 'none';
    test.selectionStart = 0;
    test.selectionEnd = 0;
    getSelection().modify("move", "left", "character");
    getSelection().modify("move", "left", "character");
    test.selectionDirection = 'none';
    test.selectionStart = 1;
    test.selectionEnd = 1;
    getSelection().modify("move", "right", "character");
    getSelection().modify("move", "right", "character");
    document.body.innerHTML = "PASS";
};

if (window.testRunner)
    testRunner.dumpAsText();

</script>
</body>
</html>
