7 testRunner.dumpAsText();
10 This test copies all the elements containing event handlers and javascript urls, pastes them
11 in an editable area and verifies that no script, handlers or javascript urls are copied.
14 <button id="button1" onclick="sayHello()" ondblclick="sayHello()" style="width: 100px;">Hello</button>
16 <a id="anchor1" href="http://www.cnn.com/">CNN</a>
17 <a id="anchor2" href="javascript:sayHello()">Hello</a>
18 <iframe id="iframe1" src="javascript:var x = 1;" style="width: 200px; height: 100px; background-color:#cee;"></iframe>
19 <form id="form1" action="javascript:sayHello()" style="width: 200px; height: 150px; background-color:#cee;">This is a form<br><img src="../resources/abe.png"></img></form>
21 <div id="pastehere" contenteditable="true">
23 <ul id="console"></ul>
25 var s = window.getSelection();
26 var p1 = document.getElementById("test");
28 s.setBaseAndExtent(p1, 0, p1, 12);
29 document.execCommand("Copy");
30 p1 = document.getElementById("pastehere");
32 document.execCommand("Paste");
34 log(document.getElementById("button1").outerHTML);
35 log(document.getElementById("pastehere").childNodes[0].outerHTML);
37 log(document.getElementById("anchor1").outerHTML);
38 log(document.getElementById("pastehere").childNodes[3].outerHTML);
40 log(document.getElementById("anchor2").outerHTML);
41 log(document.getElementById("pastehere").childNodes[5].outerHTML);
43 log(document.getElementById("iframe1").outerHTML);
44 log(document.getElementById("pastehere").childNodes[7].outerHTML);
46 log(document.getElementById("form1").outerHTML);
47 log(document.getElementById("pastehere").childNodes[8].outerHTML);
50 var li = document.createElement("li");
51 li.appendChild(document.createTextNode(str));
52 var console = document.getElementById("console");
53 console.appendChild(li);