dom/tests/mochitest/whatwg/test_bug477323.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Dynamically assigned drag and drop handlers</title>
michael@0 5 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
michael@0 6 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 7 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
michael@0 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 9 </head>
michael@0 10 <body onload="start()">
michael@0 11 <script class="testbody" type="application/javascript">
michael@0 12
michael@0 13 SimpleTest.waitForExplicitFinish();
michael@0 14
michael@0 15 function start()
michael@0 16 {
michael@0 17 var element = document.getElementById("draggable_img");
michael@0 18
michael@0 19 var gotdragstart = false, gotdrag = false,
michael@0 20 gotdragenter = false, gotdragover = false, gotdragleave = false,
michael@0 21 gotdrop = false, gotdragend = false;
michael@0 22
michael@0 23 element.ondragstart = function(event) {gotdragstart = true;}
michael@0 24 element.ondrag = function(event) {gotdrag = true;}
michael@0 25 element.ondragenter = function(event) {gotdragenter = true;}
michael@0 26 element.ondragover = function(event) {gotdragover = true;}
michael@0 27 element.ondragleave = function(event) {gotdragleave = true;}
michael@0 28 element.ondrop = function(event) {gotdrop = true;}
michael@0 29 element.ondragend = function(event) {gotdragend = true;}
michael@0 30
michael@0 31 function dispatch(eventName)
michael@0 32 {
michael@0 33 var event = document.createEvent("DragEvents");
michael@0 34 event.initDragEvent(eventName, true, true, window, 0, 5, 5, 5, 5,
michael@0 35 false, false, false, false, 0, null, null);
michael@0 36 element.dispatchEvent(event);
michael@0 37 }
michael@0 38
michael@0 39 dispatch("dragstart");
michael@0 40 dispatch("drag");
michael@0 41 dispatch("dragenter");
michael@0 42 dispatch("dragover");
michael@0 43 dispatch("dragleave");
michael@0 44 dispatch("drop");
michael@0 45 dispatch("dragend");
michael@0 46
michael@0 47 ok(gotdragstart, "Got ondragstart event");
michael@0 48 ok(gotdrag, "Got ondrag event");
michael@0 49 ok(gotdragenter, "Got ondragenter event");
michael@0 50 ok(gotdragover, "Got ondragover event");
michael@0 51 ok(gotdragleave, "Got ondragleave event");
michael@0 52 ok(gotdrop, "Got ondrop event");
michael@0 53 ok(gotdragend, "Got ondragend event");
michael@0 54
michael@0 55 SimpleTest.finish();
michael@0 56 }
michael@0 57
michael@0 58 </script>
michael@0 59
michael@0 60 <img src="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%18%00%00%00%18%02%03%00%00%00%9D%19%D5k%00%00%00%04gAMA%00%00%B1%8F%0B%FCa%05%00%00%00%0CPLTE%FF%FF%FF%FF%FF%FF%F7%DC%13%00%00%00%03%80%01X%00%00%00%01tRNS%08N%3DPT%00%00%00%01bKGD%00%88%05%1DH%00%00%00%09pHYs%00%00%0B%11%00%00%0B%11%01%7Fd_%91%00%00%00%07tIME%07%D2%05%0C%14%0C%0D%D8%3F%1FQ%00%00%00%5CIDATx%9C%7D%8E%CB%09%C0%20%10D%07r%B7%20%2F%E9wV0%15h%EA%D9%12D4%BB%C1x%CC%5C%1E%0C%CC%07%C0%9C0%9Dd7()%C0A%D3%8D%E0%B8%10%1DiCHM%D0%AC%D2d%C3M%F1%B4%E7%FF%10%0BY%AC%25%93%CD%CBF%B5%B2%C0%3Alh%CD%AE%13%DF%A5%F7%E0%03byW%09A%B4%F3%E2%00%00%00%00IEND%AEB%60%82"
michael@0 61 draggable="true" id="draggable_img"/>
michael@0 62
michael@0 63 </body>
michael@0 64 </html>

mercurial