blob: 4aa8ba0997ae9baa88415b0f9dc248ba7ce6a237 (
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
|
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Link drag and drop: events after dragenter is cancelled</title>
<script type="application/ecmascript">
function start(event)
{event.preventDefault();}
function dragMe(event)
{say('FAIL (drag event should not fire if dragstart is cancelled)');}
function enterBody(event)
{event.preventDefault();
say('FAIL (dragover event should not fire if dragstart is cancelled)');}
function overBody(event)
{event.preventDefault();
say('FAIL (dragover event should not fire if dragstart is cancelled)');}
function dropIt(event)
{say('FAIL (drop event should not fire if dragstart is cancelled)');}
function say(it)
{document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
</script>
</head>
<body ondragenter="enterBody(event)" ondragover="overBody(event)" ondrop="dropIt(event)">
<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragMe(event)">Try to drag me</a></p>
<p>You should not be able to drag link above.</p>
<pre/>
</body>
</html>
|