Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<title>Modifier keys being used with a dropzone attribute</title>
<style type="text/css">
div:first-child {
height: 100px;
width: 100px;
background: orange;
display: inline-block;
div:first-child + div {
height: 100px;
width: 100px;
background: blue;
display: inline-block;
div:first-child + div + div {
height: 100px;
width: 100px;
background: fuchsia;
display: inline-block;
table {
display: inline-table;
margin-right: 1em;
border-collapse: collapse;
table, th, td {
border: 1px solid black;
thead th {
background: silver;
color: black;
<script type="text/javascript">
window.onload = function () {
var orange = document.getElementsByTagName('div')[0];
orange.ondragstart = function (e) {
e.dataTransfer.effectAllowed = 'copy';
var fuchsia = document.getElementsByTagName('div')[2];
fuchsia.ondrop = function (e) {
//dropzone overrides the modifier, always, and ignores effectAllowed
document.getElementsByTagName('div')[3].innerHTML = ( e.dataTransfer.dropEffect == 'link' ) ? 'PASS' : 'FAIL';
<div draggable="true"></div>
<div dropzone="link string:text/plain"></div>
<li>Drag the orange square over the blue square</li>
<li>Press the relevant modifier keys for your platform to request a &quot;move&quot; drop effect (eg. Shift on Windows/Unix/Linux, Command on Mac)</li>
<li>Continue dragging over the pink square</li>
<li>If supported by the platform, the mouse cursor should show that a &quot;link&quot; drop effect will be used</li>
<li>Release the drag, then the keys</li>
<li>Fail if no new text appears above this list</li>
<noscript><p>Enable JavaScript and reload</p></noscript>