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 |
index a535a0b7227807e0d0406a48abc6df0bd6e16e5e..160aa235b740084a6c6b14632cadfa7462be56bd 100644 |
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
@@ -4,14 +4,38 @@ |
<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>', |
+ '<div style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap</a></div><div contenteditable>|</div>', |
selection => { |
- var editor = selection.document.getElementById('editor'); |
+ selection.setClipboardData('Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap</a>'); |
+ selection.document.execCommand('paste'); |
+ }, |
+ '<div style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap</a></div><div contenteditable>Copy this area <a href="http://foo/">AVeryLongWordThatWillWrap|</a></div>'), |
+ '1. Restore the collapsed space'); |
+ |
+test(() => assert_selection( |
+ '<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable>|</div>', |
+ selection => { |
+ selection.setClipboardData('<b><i>foo </i></b>bar'); |
+ selection.document.execCommand('paste'); |
+ }, |
+ '<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable><b><i>foo </i></b>bar|</div>'), |
+ '2. Restore the collapsed space'); |
- selection.document.execCommand('copy'); |
- selection.collapse(editor); |
+test(() => assert_selection( |
+ '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>|</div>', |
+ selection => { |
+ selection.setClipboardData('작은홍띠점박이푸른부전나비'); |
+ selection.document.execCommand('paste'); |
+ }, |
+ '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>작은홍띠점박이푸른부전나비|</div>'), |
+ '3. Space should not be added for CJK'); |
+ |
+test(() => assert_selection( |
+ '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicovolcanoconiosis</div><div contenteditable>|</div>', |
+ selection => { |
+ selection.setClipboardData('Pneumonoultramicroscopicsilicovolcanoconiosis'); |
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>'), |
- 'Restore the collapsed space'); |
+ '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicovolcanoconiosis</div><div contenteditable>Pneumonoultramicroscopicsilicovolcanoconiosis|</div>'), |
+ '4. Space should not be added for CSS word-break: break-all'); |
</script> |