Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/editing/dnd/images/013.xhtml - WPT Dashboard Interop Dashboard
<?xml version="1.0" encoding="utf-8"?>
<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>
<head>
<title>Drag and drop of image between frames</title>
<style>
body {
display: flex;
flex-direction: column;
height: 100vh;
}
iframe {
flex: 1;
}
</style>
</head>
<body>
<iframe src="013-1.xhtml" id="drag-iframe"></iframe>
<iframe src="helper-drop-image-here.xhtml" id="drop-iframe"></iframe>
</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>