blob: 283ae171cb020f42d11e895fa082e43477591489 [file] [log] [blame]
<script>
if (window.layoutTestController)
layoutTestController.dumpEditingCallbacks();
</script>
<style>
div {
border: 1px solid red;
}
#id {
border: 1px solid blue;
}
.class {
border: 1px solid black;
}
</style>
<body>
<p>This tests copy. Non-inheritable styles should be brought down from stylesheets.</p>
<span id="copy" style="display:block" contenteditable="true">
This shouldn't have a border.
<div class="class" id="id">This should have blue border when its pasted.</div>
This shouldn't have a border.</span>
<span id="paste" style="display:block" contenteditable="true"></span>
</body>
<script>
var sel = window.getSelection();
var copy = document.getElementById("copy");
var paste = document.getElementById("paste");
sel.setPosition(copy, 0);
document.execCommand("SelectAll");
document.execCommand("Copy");
var len = document.styleSheets[0].cssRules.length;
for (var i = 0; i < len; i++)
document.styleSheets[0].deleteRule(0);
sel.setPosition(paste, 0);
document.execCommand("Paste");
</script>
</body>