OLD | NEW |
1 <script> | 1 <script> |
2 if (window.testRunner) | 2 if (window.testRunner) |
3 testRunner.dumpEditingCallbacks(); | 3 testRunner.dumpEditingCallbacks(); |
4 </script> | 4 </script> |
5 <p>This tests copying plain text with tabs and pasting it into an editable regio
n using paste and match tyle. The tabs should be preserved.</p> | 5 <p>This tests copying plain text with tabs and pasting it into an editable regio
n using paste and match tyle. The tabs should be preserved.</p> |
6 <textarea id="textarea">Tab-> <-Tab</textarea> | 6 <textarea id="textarea">Tab-> <-Tab</textarea> |
7 | 7 |
8 <div id="div" contenteditable="true"></div> | 8 <div id="div" contenteditable="true"></div> |
9 | 9 |
10 <script> | 10 <script> |
11 var textarea = document.getElementById("textarea"); | 11 var textarea = document.getElementById("textarea"); |
12 textarea.setSelectionRange(0, 0); | 12 textarea.focus(); |
13 document.execCommand("SelectAll"); | 13 document.execCommand("SelectAll"); |
14 document.execCommand("Copy"); | 14 document.execCommand("Copy"); |
15 var div = document.getElementById("div"); | 15 var div = document.getElementById("div"); |
16 window.getSelection().collapse(div, 0); | 16 window.getSelection().collapse(div, 0); |
17 document.execCommand("PasteAndMatchStyle"); | 17 document.execCommand("PasteAndMatchStyle"); |
18 </script> | 18 </script> |
OLD | NEW |