| <script src="../../resources/js-test-pre.js"></script> |
| description('This tests peeks plain text using dataTransfer.getDAta. To manually test, click on "Copy text".'); |
| document.getElementById('source').focus(); |
| document.execCommand('SelectAll', false, null); |
| document.execCommand('Copy', false, null); |
| clipboardData = event.clipboardData; |
| shouldBeEqualToString('clipboardData.setData(" text/PLAIN ", "hello"); clipboardData.getData("text/plain")', 'hello'); |
| shouldBeEqualToString('clipboardData.setData(" tEXT/pLaIN", "world"); clipboardData.getData("text/plain")', 'world'); |
| shouldBeEqualToString('clipboardData.setData("text/plain; charset=utf-8", "hello"); clipboardData.getData("text/plain; charset=Shift_JIS")', 'hello'); |
| shouldBeEqualToString('clipboardData.clearData("url"); clipboardData.getData("text/plain")', 'hello'); |
| document.getElementById('container').style.display = 'none'; |
| window.onload = copyText; |
| successfullyParsed = true; |
| <button onclick="copyText();">Copy text</button> |
| <div id="source" oncopy="copy(event)" contenteditable="true">hello, world</div> |
| <script src="../../resources/js-test-post.js"></script> |