| <!DOCTYPE html> |
| <html> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| internals.settings.setUnsafePluginPastingEnabled(false); |
| } |
| </script> |
| <script src="../../resources/dump-as-markup.js"></script> |
| <div id="source"> |
| <p>Some text to paste.</p> |
| <embed src="http://localhost:8000/evil.swf"></embed> |
| <object data="http://localhost:8000/evil.swf"><param name="src" value="http://localhost:8000/evil.swf"><embed src="http://localhost:8000/evil.swf"></embed></object> |
| </div> |
| <div id="destination" contenteditable="true"></div> |
| <ul id="console"></ul> |
| <script> |
| var source = document.getElementById("source"); |
| var destination = document.getElementById("destination"); |
| var selection = window.getSelection(); |
| selection.setBaseAndExtent(source, 0, source, 5); |
| document.execCommand("Copy"); |
| selection.setPosition(destination, 0); |
| document.execCommand("Paste"); |
| Markup.description("This test copies embed and object elements, pastes them into an editable area, and verifies that unsafe tags are not pasted when the setting prohibits this."); |
| Markup.dump("source", "Original contents"); |
| Markup.dump("destination", "Pasted contents"); |
| </script> |
| </html> |