blob: 699ad6f80e3fd52cff8253d34ba32b2ae08a59f5 [file] [log] [blame]
<html>
<head>
<style>
blockquote {
color: blue;
border-left: 2px solid blue;
margin-left: 0px;
padding-left: 10px;
}
</style>
</head>
<body>
<div id="description">This tests to make sure that content that has the document default color is pasted as blue (or whatever the color for quoted content is) during a Paste as Quotation.</div>
<div id="edit" contenteditable="true"></div>
<script>
document.addEventListener("beforecopy", (event) => event.preventDefault());
document.addEventListener("copy", (event) => {
event.clipboardData.setData("text/html", "<span class='Apple-style-span' style='color: black;'>This text should be blue (it should not be wrapped in a style span).</span>");
event.preventDefault();
});
document.execCommand("Copy", false);
edit = document.getElementById("edit");
description = document.getElementById("description");
edit.focus();
document.execCommand("PasteAsQuotation", false);
if (window.testRunner) {
window.testRunner.dumpAsText();
document.body.innerText = description.innerText + "\n" + edit.innerHTML;
}
</script>
</body>
</html>