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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html

Issue 2280513004: Restore a collapsed trailing space of text used for line break (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add CJK and word-break: break-all cases Created 4 years, 4 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
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..28a4a96e9f23c1f4ad36bbe64ac85a47ed9e8bfd 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/preserve-trailing-space.html
@@ -13,5 +13,44 @@ test(() => assert_selection(
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');
+ '1. Restore the collapsed space');
+
+test(() => assert_selection(
+ '<div style="width: 2em;"><b><i>^foo </i></b>bar|</div><div contenteditable id="editor"></div>',
+ selection => {
+ var copy = selection.document.getElementById('copy');
+ var editor = selection.document.getElementById('editor');
+
+ selection.document.execCommand('copy');
+ selection.collapse(editor);
+ selection.document.execCommand('paste');
+ },
+ '<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable id="editor"><b><i>foo\u00A0</i></b>bar|</div>'),
+ '2. Restore the collapsed space');
+
+test(() => assert_selection(
+ '<div style="width: 2em;">^작은홍띠점박이푸른부전나비|</div><div contenteditable id="editor"></div>',
+ selection => {
+ var copy = selection.document.getElementById('copy');
+ var editor = selection.document.getElementById('editor');
+
+ selection.document.execCommand('copy');
+ selection.collapse(editor);
+ selection.document.execCommand('paste');
+ },
+ '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable id="editor">작은홍띠점박이푸른부전나비|</div>'),
+ '3. Space should not be added for CJK');
+
+test(() => assert_selection(
+ '<div style="width: 2em; word-break: break-all">^Pneumonoultramicroscopicsilicovolcanoconiosis|</div><div contenteditable id="editor"></div>',
+ selection => {
+ var copy = selection.document.getElementById('copy');
+ var editor = selection.document.getElementById('editor');
+
+ selection.document.execCommand('copy');
+ selection.collapse(editor);
+ selection.document.execCommand('paste');
+ },
+ '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicovolcanoconiosis</div><div contenteditable id="editor">Pneumonoultramicroscopicsilicovolcanoconiosis|</div>'),
+ '4. Space should not be added for CSS word-break: break-all');
joone 2016/08/29 17:58:29 kojii@ Here are the cases you wanted to test.
</script>

Powered by Google App Engine
This is Rietveld 408576698