021.html (1900B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testdriver.js"></script> 5 <script src="/resources/testdriver-vendor.js"></script> 6 <script src="/resources/testdriver-actions.js"></script> 7 <script src="../resources/test-helper.js"></script> 8 <head> 9 <title>Dropping image on the root scrollbar of an iframe. No drop event should be sent.</title> 10 <style type="text/css"> 11 p:first-child { 12 padding-left: 1em; 13 } 14 15 iframe { 16 height: 4em; 17 width: 4em; 18 } 19 20 img { 21 width: 5px; 22 height: 5px; 23 } 24 </style> 25 <script type="application/ecmascript"> 26 function dragImage() { 27 event.dataTransfer.effectAllowed = 'copy'; 28 } 29 </script> 30 </head> 31 <body ondragenter="event.preventDefault()" ondragover="return false"> 32 <p><img 33 src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" 34 alt="PNG green pixel" ondragstart="dragImage()" /></p> 35 <p>Drag little square above and drop it on horizontal scrollbar. The drop event should not be sent, and the word PASS should not appear in the iframe.</p> 36 <iframe src="helper-drop-horizontal-scrollbar.xhtml">XHTML document</iframe> 37 <script> 38 async function test() { 39 await new Promise(loaded => window.addEventListener("load", loaded)); 40 41 const img = document.querySelector('img'); 42 const iframe = document.querySelector('iframe'); 43 const innerDoc = iframe.contentDocument || iframe.contentWindow.document; 44 const div = innerDoc.querySelector('div'); 45 46 dragDropTestNoDropEvent(img, div, 47 'Dragging the image to the horizontal iframe scrollbar should NOT trigger drop event', 48 /*dragIframe=*/ null, iframe, DropPosition.HORIZONTAL_SCROLLBAR); 49 } 50 test(); 51 </script> 52 </body> 53 </html>