blob: 2bba2dc7b444be34c1ac431aa0b6a9e6f2a0de07 [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 two boxes with blockquoted "foo" text, followed by a box with an unquoted "x".
<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');
selection.modify('move', 'backward', 'character');
document.execCommand('paste');
assert_equals(sample.innerHTML, '<blockquote>foofoox</blockquote>');
assert_true(selection.isCollapsed);
assert_equals(selection.anchorNode, sample.querySelector('blockquote').firstChild);
assert_equals(selection.anchorOffset, 6);
});
</script>