<html>
<head>
<script>
if (window.testRunner)
     testRunner.dumpEditingCallbacks();
</script>

<title>An upstream caret can be impossible to create</title>
<script>
function runTest() {
    if (window.testRunner) {
        var e = document.getElementById("clickme");
        var x = e.offsetLeft + e.offsetWidth + 15;
        var y = e.offsetTop + e.offsetHeight / 2;
        
        eventSender.mouseMoveTo(x, y);
        eventSender.mouseDown();
        eventSender.mouseUp();
    }
}
</script>
</head>
<body onLoad="runTest();">
<div style="width:250px;" id="test" contenteditable="true">Try to create a caret after this lin<span id="clickme">e</span> <span></span>thisshouldbeonthesecondline </div>
<hr>
<p>This is a testcase for <a href="https://bugs.webkit.org/show_bug.cgi?id=6476">http://bugzilla.opendarwin.org/show_bug.cgi?id=6476</a>.  Creating an upstream caret with the mouse was impossible if the upstream and downstream carets were separated only by unrendered content.</p><p>This test uses the eventSender to do mouse clicks.  To run it manually, click in the space after all the text on the first line in the above editable region.  Clicking should create a caret after the first space after the 'e'.</p>
</body></html>
