Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<?xml version="1.0" encoding="utf-8"?>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="../resources/test-helper.js"></script>
<title>Image drag and drop between iframes</title>
<style type="text/css">
iframe {
width: 160px;
height: 160px;
border-style: none;
}
</style>
</head>
<body>
<p><iframe src="helper-circle.xhtml" id="drag-iframe">XHTML with image</iframe></p>
<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
<p><iframe src="helper-drop-image-here.xhtml" id="drop-iframe">XHTML with image</iframe></p>
</body>
<script>
async function test() {
await new Promise(loaded => window.addEventListener("load", loaded));
const img = frames[0].document.querySelector('img');
const div = frames[1].document.querySelector('div');
function onDropCallBack(event) {
assert_equals(div.querySelector('img').src, img.src);
return true;
}
const dragIframe = document.getElementById('drag-iframe');
const dropIframe = document.getElementById('drop-iframe');
dragDropTest(img, div, onDropCallBack, 'Dragging the image to the bottom div should copy the image there',
dragIframe, dropIframe);
}
test();
</script>
</html>