<!DOCTYPE html>
<html>
<head>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="resources/js-test-selection-shared.js"></script>
</head>
<body>
<p>This tests collapsing directionless selection on text in a block with the opposite text direction.
To manually test, on Mac, select text below by mouse and use arrow keys (without pressing shift) to collapse the selection.
The selection should collapse to the left if you pressed the left arrow key and to the right if you pressed the right arrow key.</p>
<div id="tests" contenteditable><span dir="ltr">&#x05d0;&#x05d1;&#x05d2;&#x05d3;&#x05d4;</span
><span dir="rtl">hello</span></div>
<pre id="console"></pre>
<script>

if (window.layoutTestController) {
    layoutTestController.setEditingBehavior('mac');

    function selectTarget(target) {
        eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth * 2 / 5, target.offsetTop + 5);
        eventSender.mouseDown();
        eventSender.leapForward(200);
        eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth * 4 / 5, target.offsetTop + 5);
        eventSender.leapForward(200);
        eventSender.mouseUp();
    }

    var selection = window.getSelection();
    var tests = document.getElementById('tests').getElementsByTagName('span');
    for (var i = 0; i < tests.length; i++) {
        var isLTR = tests[i].dir == 'ltr';

        selectTarget(tests[i]);
        var expectedOffset = isLTR ? window.getSelection().getRangeAt(0).endOffset : window.getSelection().getRangeAt(0).startOffset;
        window.getSelection().modify('move', 'left', 'character');
        assertSelectionAt(tests[i].firstChild, expectedOffset);

        selectTarget(tests[i]);
        expectedOffset = isLTR ? window.getSelection().getRangeAt(0).startOffset : window.getSelection().getRangeAt(0).endOffset;
        window.getSelection().modify('move', 'right', 'character');
        assertSelectionAt(tests[i].firstChild, expectedOffset);
    }

    document.getElementById('tests').style.display = 'none';
}


</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
