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

Unified Diff: LayoutTests/editing/pasteboard/copy-text-with-wrapped-tag.html

Issue 753573003: Copy and paste sometimes removes spaces between words. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
Index: LayoutTests/editing/pasteboard/copy-text-with-wrapped-tag.html
diff --git a/LayoutTests/editing/pasteboard/copy-text-with-wrapped-tag.html b/LayoutTests/editing/pasteboard/copy-text-with-wrapped-tag.html
new file mode 100644
index 0000000000000000000000000000000000000000..fbae2cba604ee74414583fb5177767e0d3f748d0
--- /dev/null
+++ b/LayoutTests/editing/pasteboard/copy-text-with-wrapped-tag.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="description">This tests to make sure that copying and pasting a text followed by an anchor tag wrapped into 2nd line do not lose the space between text and tag in the destination.</div>
+<div id="copy" style="width: 10em; border: thin solid green;">Copy this text <a href="http://www.google.com">AVeryLongWordThatWillWrap</a></div>
+<div id="copy2" style="width: 10em; border: thin solid green;">Copy multiple spaces <a href="http://www.google.com">AVeryLongWordThatWillWrap</a></div>
+<div id="paste" contentEditable="true" style="border: thin solid blue;"></div>
+
+<script src="../../resources/dump-as-markup.js"></script>
+<script>
+
+Markup.description(document.getElementById('description').textContent);
+Markup.dump('copy', 'Original');
+
+copy = document.getElementById("copy");
+window.getSelection().setBaseAndExtent(copy, 0, copy, copy.childNodes.length);
+document.execCommand("Copy");
+
+if (window.testRunner) {
+ paste = document.getElementById("paste");
+ window.getSelection().setPosition(paste, 0);
+ document.execCommand("Paste");
+
+ Markup.dump('paste', 'Pasted');
+}
+
+copy2 = document.getElementById("copy2");
+window.getSelection().setBaseAndExtent(copy2, 0, copy2, copy2.childNodes.length);
+document.execCommand("Copy");
+
+if (window.testRunner) {
+ paste = document.getElementById("paste");
+ window.getSelection().setPosition(paste, 0);
+ document.execCommand("SelectAll");
+ document.execCommand("Paste");
+
+ Markup.dump('paste', 'Pasted2');
+}
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698