011.xhtml (1549B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testdriver.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <script src="/resources/testdriver-actions.js"></script> 9 <script src="../resources/test-helper.js"></script> 10 <title>Image drag and drop between iframes</title> 11 <style type="text/css"> 12 iframe { 13 width: 160px; 14 height: 160px; 15 border-style: none; 16 } 17 </style> 18 </head> 19 <body> 20 <p><iframe src="helper-circle.xhtml" id="drag-iframe">XHTML with image</iframe></p> 21 <p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p> 22 <p><iframe src="helper-drop-image-here.xhtml" id="drop-iframe">XHTML with image</iframe></p> 23 </body> 24 <script> 25 async function test() { 26 await new Promise(loaded => window.addEventListener("load", loaded)); 27 const img = frames[0].document.querySelector('img'); 28 const div = frames[1].document.querySelector('div'); 29 30 function onDropCallBack(event) { 31 assert_equals(div.querySelector('img').src, img.src); 32 return true; 33 } 34 35 const dragIframe = document.getElementById('drag-iframe'); 36 const dropIframe = document.getElementById('drop-iframe'); 37 dragDropTest(img, div, onDropCallBack, 'Dragging the image to the bottom div should copy the image there', 38 dragIframe, dropIframe); 39 } 40 test(); 41 </script> 42 </html>