Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html

Issue 1809033002: Pasting \n into an empty TEXTAREA should set the caret after the \n. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
index 6abc16776cad5a86d7ae0889d608f1cf07d24ca9..96f5e2e078d7962509430996cc6e3a3b4dc34833 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
@@ -17,4 +17,21 @@ test(function() {
document.execCommand("paste");
assert_equals(ta.value, "abc\nabc\n");
}, "Pasting text ending with newline should work correctly.");
+
+test(function() {
+ var source = document.createElement("textarea");
+ document.body.appendChild(source);
+ source.value = "\n";
+ source.focus();
+ source.select();
+ document.execCommand("copy");
+
+ var dest = document.createElement("textarea");
+ document.body.appendChild(dest);
+ dest.focus();
+ document.execCommand("paste");
+ assert_equals(dest.value, "\n");
+ assert_equals(dest.selectionStart, 1);
+ assert_equals(dest.selectionEnd, 1);
+}, "Pasting \\n into an empty TEXTAREA should set the caret at the end.");
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698