blob: 2a0dbe128d4e606397b52c57f8c076fcce39b561 [file] [log] [blame]
<html>
<head>
<script src=../../editing.js></script>
<script>
function editingTest() {
let selection = window.getSelection();
let copyRange = document.createRange();
copyRange.selectNodeContents(document.getElementById("copy"));
selection.removeAllRanges();
selection.addRange(copyRange);
copyFontCommand();
let pasteRange = document.createRange();
pasteRange.selectNodeContents(document.getElementById("paste"));
selection.removeAllRanges();
selection.addRange(pasteRange);
pasteFontCommand();
selection.removeAllRanges();
}
</script>
<style>
#copy {
background-color: green;
font-family: Arial;
font-size: 20px;
font-weight: bold;
font-style: italic;
color: yellow;
text-shadow: black 1px 1px;
vertical-align: sub;
}
#paste {
outline: none;
}
</style>
</head>
<body>
<div id="copy">copy this</div>
<div id="paste" contenteditable>paste here</div>
<script>
runEditingTest();
</script>
</body>
</html>