4 if (window
.testRunner
) {
5 testRunner
.dumpAsText();
6 internals
.settings
.setUnsafePluginPastingEnabled(false);
9 <script src=
"../../resources/dump-as-markup.js"></script>
11 <p>Some text to paste.
</p>
12 <embed src=
"http://localhost:8000/evil.swf"></embed>
13 <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>
15 <div id=
"destination" contenteditable=
"true"></div>
16 <ul id=
"console"></ul>
18 var source
= document
.getElementById("source");
19 var destination
= document
.getElementById("destination");
20 var selection
= window
.getSelection();
21 selection
.setBaseAndExtent(source
, 0, source
, 5);
22 document
.execCommand("Copy");
23 selection
.collapse(destination
, 0);
24 document
.execCommand("Paste");
25 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.");
26 Markup
.dump("source", "Original contents");
27 Markup
.dump("destination", "Pasted contents");