blob: 8ce25069a35c5c3c492593339ac0c3706efec81d [file] [log] [blame]
<html>
<head>
<link rel=stylesheet href="../editingStyle.css" type="text/css">
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
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.layoutTestController)
window.layoutTestController.dumpAsText();
var textarea = document.getElementById("test");
// set the cursor several characters into the first line of the text area so
// that when you go down by a line, the cursor will be at the end of the
// numbered lines:
textarea.setSelectionRange(5, 5);
for (var i = 0; i < 10; i++) {
// press the 'down arrow' a bunch of times to try to get to the end of
// the text area
moveSelectionForwardByLineCommand();
}
if (textarea.selectionStart != textarea.value.length)
log ("Fail. Expected: selectionStart == " + textarea.value.length + ", Found: " + textarea.selectionStart);
else
log("Success");
}
</script>
</head>
<body>
<p>
This tests that the cursor doesn't get 'stuck' when advancing through a
text area with the down arrow key. See bug #19465 for more information
</p>
<p>
If the test is successful and the cursor is at the end of the textarea, you should see the word 'Success' printed below
</p>
<textarea id="test" rows="10" cols="80">What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?</textarea>
<ul id="console"></ul>
<script>
runEditingTest();
</script>
</body>
</html>