| OLD | NEW |
| 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 Loading... |
| 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'); |
| 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> |
| OLD | NEW |