blob: f46d3034c668129245bc777783ce79ce03ee46d1 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
See this bug: <a href="rdar://problem/3918712">&lt;rdar://problem/3918712&gt;</a> "Paste as Quotation" in Mail just pastes (&lt;blockquote&gt; tag seems to be lost).
Should see one box with blockquoted "foo" text, followed by another box with an "x" (not in a blockquote) and "foo" (in a blockquote).
<div id="sample" contenteditable><div><blockquote>foo</blockquote></div></div>
<div id="log"></div>
<script>
test(function() {
var selection = window.getSelection();
var sample = document.getElementById('sample');
selection.collapse(sample, 0);
for (i = 0; i < 4; i++)
selection.modify('extend', 'forward', 'character');
document.execCommand('copy');
selection.modify('move', 'forward', 'character');
document.execCommand('insertText', false, 'x');
document.execCommand('paste');
assert_equals(sample.innerHTML, '<div><blockquote>fooxfoo</blockquote></div>');
assert_true(selection.isCollapsed);
assert_equals(selection.anchorNode, sample.querySelector('blockquote').firstChild);
assert_equals(selection.anchorOffset, 7);
});
</script>