blob: e5159716f4f3d1655fa7d37b3cc4a1e846a48584 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<!DOCTYPE html>
<html>
<head>
<title>Drag and drop with right click</title>
<style type="text/css">
div {
width: 100px;
height: 100px;
background: orange;
float: left;
}
div + div {
background: blue;
}
div + div + div {
background: fuchsia;
}
ol {
clear: left;
}
</style>
<script type="text/javascript">
window.onload = function () {
document.getElementsByTagName('div')[0].ondragstart = function (e) {
e.dataTransfer.effectAllowed = 'copy';
e.dataTransfer.setData('text','dummy text');
};
};
</script>
</head>
<body>
<div draggable="true"></div>
<div></div>
<div></div>
<noscript><p>Enable JavaScript and reload</p></noscript>
<ol>
<li>Drag the orange square over the blue square.</li>
<li>Without releasing the drag, click the right mouse button.</li>
<li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled;<ul>
<li>The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
<li>Move the mouse over the pink square and release the drag. The mouse cursor should remain the normal mouse cursor.</li>
</ul></li>
<li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled;<ul>
<li>The drag placeholder should not disappear, and the cursor should be the no-drop cursor.</li>
<li>Move the mouse over the pink square and release the drag. The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
</ul></li>
<li>Fail in either case if an inappropriate right click function begins (eg. context menu opens).</li>
</ol>
</body>
</html>
|