| OLD | NEW |
| (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 style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordT
hatWillWrap</a></div><div contenteditable>|</div>', | |
| 8 selection => { | |
| 9 selection.setClipboardData('Copy this area <a href="http://foo/">AVeryLongWo
rdThatWillWrap</a>'); | |
| 10 selection.document.execCommand('paste'); | |
| 11 }, | |
| 12 '<div style="width: 10em;">Copy this area <a href="http://foo/">AVeryLongWordT
hatWillWrap</a></div><div contenteditable>Copy this area <a href="http://foo/">A
VeryLongWordThatWillWrap|</a></div>'), | |
| 13 '1. Restore the collapsed space'); | |
| 14 | |
| 15 test(() => assert_selection( | |
| 16 '<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable>|</d
iv>', | |
| 17 selection => { | |
| 18 selection.setClipboardData('<b><i>foo </i></b>bar'); | |
| 19 selection.document.execCommand('paste'); | |
| 20 }, | |
| 21 '<div style="width: 2em;"><b><i>foo </i></b>bar</div><div contenteditable><b><i
>foo </i></b>bar|</div>'), | |
| 22 '2. Restore the collapsed space'); | |
| 23 | |
| 24 test(() => assert_selection( | |
| 25 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>|</div>', | |
| 26 selection => { | |
| 27 selection.setClipboardData('작은홍띠점박이푸른부전나비'); | |
| 28 selection.document.execCommand('paste'); | |
| 29 }, | |
| 30 '<div style="width: 2em;">작은홍띠점박이푸른부전나비</div><div contenteditable>작은홍띠점박이푸른부전나비
|</div>'), | |
| 31 '3. Space should not be added for CJK'); | |
| 32 | |
| 33 test(() => assert_selection( | |
| 34 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilico
volcanoconiosis</div><div contenteditable>|</div>', | |
| 35 selection => { | |
| 36 selection.setClipboardData('Pneumonoultramicroscopicsilicovolcanoconiosis'); | |
| 37 selection.document.execCommand('paste'); | |
| 38 }, | |
| 39 '<div style="width: 2em; word-break: break-all">Pneumonoultramicroscopicsilicov
olcanoconiosis</div><div contenteditable>Pneumonoultramicroscopicsilicovolcanoco
niosis|</div>'), | |
| 40 '4. Space should not be added for CSS word-break: break-all'); | |
| 41 </script> | |
| OLD | NEW |