summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html')
-rw-r--r--Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html b/Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html
new file mode 100644
index 0000000..0203199
--- /dev/null
+++ b/Source/WebCore/manual-tests/selection-start-after-inserting-line-break-in-textarea.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests selectionStart is updated properly when inserting LF into textarea. To test, press Enter several times inside textarea and click the log button. This bug does not reproduce when new lines are added by execCommand or eventSender.</p>
+<textarea cols="20" rows="20"></textarea>
+<button id="button" onclick="verify()">verify</button>
+<div id="console"></div>
+<script>
+
+function verify() {
+ var console = document.getElementById('console');
+ if (textarea.value.match(/[^\n]/))
+ console.innerHTML = 'textarea contains unexpected character. You can only type LF in this test.';
+ else if (textarea.selectionStart != textarea.value.length)
+ console.innerHTML = 'FAIL: expected ' + textarea.value.length + ' but got ' + textarea.selectionStart;
+ else
+ console.innerHTML = 'PASS: ' + textarea.value.length + ' LFs';
+}
+
+var textarea = document.getElementsByTagName('textarea')[0];
+textarea.focus();
+
+</script>
+</body>
+</html>