Index: third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html |
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html b/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html |
similarity index 76% |
rename from third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
rename to third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html |
index 160aa235b740084a6c6b14632cadfa7462be56bd..a7ba4ce9455aeaff34ce9e11cbfad776aaff883f 100644 |
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html |
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html |
@@ -10,7 +10,7 @@ test(() => assert_selection( |
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'); |
+ '1. Restore the collapsed trailing space'); |
test(() => assert_selection( |
'<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable>|</div>', |
@@ -19,7 +19,16 @@ test(() => assert_selection( |
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'); |
+ '2. Restore the collapsed trailing 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>'), |
+ '3. Restore the collapsed leading space'); |
test(() => assert_selection( |
'<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>|</div>', |
@@ -28,7 +37,7 @@ test(() => assert_selection( |
selection.document.execCommand('paste'); |
}, |
'<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>작은홍띠점박이푸른부전나비|</div>'), |
- '3. Space should not be added for CJK'); |
+ '4. Space should not be added for CJK'); |
test(() => assert_selection( |
'<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicovolcanoconiosis</div><div contenteditable>|</div>', |
@@ -37,5 +46,5 @@ test(() => assert_selection( |
selection.document.execCommand('paste'); |
}, |
'<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'); |
+ '5. Space should not be added for CSS word-break: break-all'); |
</script> |