blob: c6badca8f6bc963539200185a7eb3987b50bb81f [file] [edit]
<!DOCTYPE html>
<html>
<head>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description("This tests that copying and pasting an image in a picture element and adjacent text, preserves the picture and source elements.");
Markup.noAutoDump();
function runTest()
{
var picture = document.getElementById("picture");
execSetSelectionCommand(picture, 2, picture.nextSibling, 5);
execCopyCommand();
document.getElementById("paste-contenteditable").innerHTML = "Paste";
selection.setPosition(document.getElementById("paste-contenteditable").childNodes[0], 5);
execPasteCommand();
Markup.dump("paste-contenteditable");
}
window.onload = function()
{
if (window.testRunner)
testRunner.dumpAsText();
runTest();
Markup.notifyDone();
};
</script>
</head>
<body>
<div id="copy-contenteditable" contenteditable>
Test<picture id="picture"><source srcset="resources/apple.gif" media="(min-width: 600px)"/><source srcset="resources/mozilla.gif"/><img src=""></picture>After
</div>
<div id="paste-contenteditable" contentEditable="true"></div>
</body>
</html>