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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html

Issue 2325553002: Restore a collapsed leading space of text used for line break (Closed)
Patch Set: Make FindInPageControllerTest.SpanAndListsSearchable pass Created 4 years, 3 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
1 <!doctype HTML> 1 <!doctype HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script> 4 <script src="../assert_selection.js"></script>
5 <script> 5 <script>
6 test(() => assert_selection( 6 test(() => assert_selection(
7 '<div style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordT hatWillWrap</a></div><div contenteditable>|</div>', 7 '<div style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordT hatWillWrap</a></div><div contenteditable>|</div>',
8 selection => { 8 selection => {
9 selection.setClipboardData('Copy this area <a href="http://foo/">AVeryLongWo rdThatWillWrap</a>'); 9 selection.setClipboardData('Copy this area <a href="http://foo/">AVeryLongWo rdThatWillWrap</a>');
10 selection.document.execCommand('paste'); 10 selection.document.execCommand('paste');
(...skipping 13 matching lines...) Expand all
24 test(() => assert_selection( 24 test(() => assert_selection(
25 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable>|</d iv>', 25 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable>|</d iv>',
26 selection => { 26 selection => {
27 selection.setClipboardData('<b><i>foo</i></b> bar'); 27 selection.setClipboardData('<b><i>foo</i></b> bar');
28 selection.document.execCommand('paste'); 28 selection.document.execCommand('paste');
29 }, 29 },
30 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable><b>< i>foo</i></b> bar|</div>'), 30 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable><b>< i>foo</i></b> bar|</div>'),
31 '3. Restore the collapsed leading space'); 31 '3. Restore the collapsed leading space');
32 32
33 test(() => assert_selection( 33 test(() => assert_selection(
34 '<div style="width: 2em;"><b><i>^foo</i></b> bar|</div><div contenteditable id ="editor"></div>',
35 selection => {
36 var copy = selection.document.getElementById('copy');
37 var editor = selection.document.getElementById('editor');
38
39 selection.document.execCommand('copy');
yosin_UTC9 2016/09/12 04:09:10 We can use internals.selectedTextForClipboard() to
joone 2016/09/12 21:33:02 html = <b style="color: rgb(0, 0, 0); font-family:
yosin_UTC9 2016/09/13 02:00:30 Since StyledMarkupAccumulator::renderedText() call
joone 2016/09/14 04:04:35 Done.
40 selection.collapse(editor);
41 selection.document.execCommand('paste');
42 },
43 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable id=" editor"><b><i>foo</i></b>\u00A0bar|</div>'),
44 '4. Restore the collapsed leading space');
45
46 test(() => assert_selection(
34 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>|</div>', 47 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>|</div>',
35 selection => { 48 selection => {
36 selection.setClipboardData('작은홍띠점박이푸른부전나비'); 49 selection.setClipboardData('작은홍띠점박이푸른부전나비');
37 selection.document.execCommand('paste'); 50 selection.document.execCommand('paste');
38 }, 51 },
39 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>작은홍띠점박이푸른부전나비 |</div>'), 52 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>작은홍띠점박이푸른부전나비 |</div>'),
40 '4. Space should not be added for CJK'); 53 '5. Space should not be added for CJK');
41 54
42 test(() => assert_selection( 55 test(() => assert_selection(
43 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilico volcanoconiosis</div><div contenteditable>|</div>', 56 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilico volcanoconiosis</div><div contenteditable>|</div>',
44 selection => { 57 selection => {
45 selection.setClipboardData('Pneumonoultramicroscopicsilicovolcanoconiosis'); 58 selection.setClipboardData('Pneumonoultramicroscopicsilicovolcanoconiosis');
46 selection.document.execCommand('paste'); 59 selection.document.execCommand('paste');
47 }, 60 },
48 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicov olcanoconiosis</div><div contenteditable>Pneumonoultramicroscopicsilicovolcanoco niosis|</div>'), 61 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicov olcanoconiosis</div><div contenteditable>Pneumonoultramicroscopicsilicovolcanoco niosis|</div>'),
49 '5. Space should not be added for CSS word-break: break-all'); 62 '6. Space should not be added for CSS word-break: break-all');
50 </script> 63 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698