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