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

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

Issue 2193033004: Restore the collapsed spaces of the text when we copy it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test cases for <div><b><i>foo </i></b> bar</div> 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype HTML>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 test(() => assert_selection(
7 '<div id="copy" style="width: 10em;">^Copy this area <a href="http://foo/">AVe ryLongWordThatWillWrap|</a></div><div contenteditable id="editor"></div>',
8 selection => {
9 var copy = selection.document.getElementById('copy');
10 var editor = selection.document.getElementById('editor');
11
12 selection.document.execCommand('copy');
13 selection.collapse(editor);
14 selection.document.execCommand('paste');
15 },
16 '<div id="copy" style="width: 10em;">Copy this area <a href="http://foo/">AVer yLongWordThatWillWrap</a></div><div contenteditable id="editor">Copy this area\u 00A0<a href="http://foo/">AVeryLongWordThatWillWrap|</a></div>'),
17 'insert a plain space between two inserted text nodes');
18
19 test(() => assert_selection(
20 '<div><b><i>^foo</i></b> bar|</div><div contenteditable id="editor"></div>',
21 selection => {
22 var copy = selection.document.getElementById('copy');
23 var editor = selection.document.getElementById('editor');
24
25 selection.document.execCommand('copy');
26 selection.collapse(editor);
27 selection.document.execCommand('paste');
28 },
29 '<div><b><i>foo</i></b> bar</div><div contenteditable id="editor"><b><i>foo</i ></b>\u00A0bar|</div>'),
30 'insert a plain space between two inserted text nodes');
31
32 test(() => assert_selection(
33 '<div><b><i>^foo </i></b>bar|</div><div contenteditable id="editor"></div>',
34 selection => {
35 var copy = selection.document.getElementById('copy');
36 var editor = selection.document.getElementById('editor');
37
38 selection.document.execCommand('copy');
39 selection.collapse(editor);
40 selection.document.execCommand('paste');
41 },
42 '<div><b><i>foo </i></b>bar</div><div contenteditable id="editor"><b><i>foo\u0 0A0</i></b>bar|</div>'),
43 'insert a plain space between two inserted text nodes');
44
45
46 test(() => assert_selection(
47 '<div><b><i>^foo </i></b> bar|</div><div contenteditable id="editor"></div>',
48 selection => {
49 var copy = selection.document.getElementById('copy');
50 var editor = selection.document.getElementById('editor');
51
52 selection.document.execCommand('copy');
53 selection.collapse(editor);
54 selection.document.execCommand('paste');
55 },
56 '<div><b><i>foo </i></b> bar</div><div contenteditable id="editor"><b><i>foo\u 00A0</i></b>bar|</div>'),
joone 2016/08/03 21:51:00 In this case, only one space is reserved.
57 'insert a plain space between two inserted text nodes');
58 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698