blob: 64a58b9e0a207bb02b7ed6466094ca49b0b52317 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body onload="runTest()">
<div id="description">
This test copies the content of an iframe and pastes it
in an editable area in an xhtml document and verifies that no script, handlers or javascript urls are copied.
</div>
<iframe id="iframe1" src="resources/paste-noscript-content.html"></iframe>
<div id="pastehere" contenteditable="true"></div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.waitUntilDone();
function runTest() {
Markup.description(document.getElementById('description').textContent);
var doc = frames[0].document;
getSelection().setPosition(doc.body, 0);
doc.execCommand("SelectAll");
doc.execCommand("Copy");
frames[0].getSelection().empty();
Markup.dump(doc.body, 'Copied content');
getSelection().setPosition(document.getElementById("pastehere"), 0);
document.execCommand("Paste");
getSelection().empty();
Markup.dump('pastehere', 'Pasted content');
Markup.notifyDone();
}
</script>
</body>
</html>