<p>
    Test for <i><a href="rdar://problem/5973313">rdar://problem/5973313</a>
    REGRESSION (r32508): Down arrow doesn't change caret with non-user entered newlines in textareas</i>.
</p>
<p>
    To test manually, click to the right of the first word on the first line to place
    the caret at the end of the line, then press the down arrow. The caret should move
    to the next (empty) line. Then click somewhere on that line. The caret should not
    stay there.
</p>
<div id="target" style="border: solid red; -webkit-user-modify: read-write; white-space: pre;">Lorem

ipsum</div>
<script>
    if (window.layoutTestController) {
        layoutTestController.dumpAsText();
        layoutTestController.dumpEditingCallbacks();
        var target = document.getElementById("target");
        var x = target.offsetParent.offsetLeft + target.offsetLeft;
        var y = target.offsetParent.offsetTop + target.offsetTop;
        eventSender.mouseMoveTo(x + target.offsetWidth - 10, y + 2);
        eventSender.mouseDown();
        eventSender.mouseUp();
        getSelection().modify("move", "forward", "line");
        eventSender.mouseMoveTo(x + target.offsetWidth - 10, y + target.offsetHeight / 2);
        eventSender.mouseDown();
        eventSender.mouseUp();
    }
</script>
