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(() => { | 6 test(() => { |
7 assert_not_equals(window.internals, undefined, | 7 assert_not_equals(window.internals, undefined, |
8 'This test requires window.internals to access clipboard'); | 8 'This test requires window.internals to access clipboard'); |
9 | 9 |
10 assert_selection( | 10 assert_selection( |
11 '<div contenteditable>^one|<br>two</div>', | 11 '<div contenteditable><b>|<br></b></div>', |
12 selection => { | 12 selection => { |
13 selection.document.execCommand('cut'); | 13 selection.setClipboardData('abc'); |
14 selection.document.execCommand('paste'); | 14 selection.document.execCommand('pasteAndMatchStyle'); |
15 }, | 15 }, |
16 '<div contenteditable>one|<br>two</div>', | 16 '<div contenteditable><b>abc|</b></div>', |
17 'Paste before placeholder'); | 17 'pasteAndMatchStyle'); |
18 }); | 18 }); |
19 </script> | 19 </script> |
OLD | NEW |