Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html b/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d94d77219a321627862514be9862556ada113d83 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
| @@ -0,0 +1,21 @@ |
| +<!doctype HTML> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../assert_selection.js"></script> |
| +<script> |
| +test(() => assert_selection( |
| + '<div id="copy" style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap</a></div><div contenteditable id="editor"></div>', |
| + selection => { |
| + var copy = selection.document.getElementById('copy'); |
| + var editor = selection.document.getElementById('editor'); |
| + selection.removeAllRanges(); |
| + var range = document.createRange(); |
|
yosin_UTC9
2016/08/03 01:16:23
Since you don't use |range| other than setting |se
joone
2016/08/03 21:50:59
Done.
|
| + range.selectNode(copy); |
| + selection.addRange(range); |
| + selection.document.execCommand('copy'); |
| + selection.collapse(editor); |
| + selection.document.execCommand('paste'); |
| + }, |
| + '<div id="copy" style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap</a></div><div contenteditable id="editor">Copy this area\u00A0<a href="http://foo/">AVeryLongWordThatWillWrap|</a></div>'), |
| + 'insert a plain space between two inserted text nodes'); |
| +</script> |