summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/target-origin/008-manual.html
blob: 71e915c9cdef4ac478054dfbe3e6d1cde97811cc (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
51
52
53
<!doctype html>
<html>
	<head>
		<title>Data URI does match *</title>
	</head>
	<body>
		<!--
* allows any URL at all, so it should work
		-->
		<p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
		<noscript><p>Enable JavaScript and reload</p></noscript>

		<script type="text/javascript">
document.write('data:text/html,'+escape(
'<!doctype html>\
<html>\
	<head>\
		<title>Data URI does match *<\/title>\
		<style type="text/css">\
html, body { margin: 0; padding: 0; }\
div { height: 100px; width: 100px; background: orange; }\
iframe { border: none; height: 150px; width: 150px; }\
		<\/style>\
	<\/head>\
	<body>\
		<script type="text/javascript">\
var seentypes = {};\
if( self == top ) {\
	document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {\
		e.preventDefault();\
		if( e.type == "drop" ) {\
			document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover ) ? "PASS" : "FAIL";\
		} else {\
			seentypes[e.type] = true;\
		}\
	};\
	document.write("<p>Drag the orange square below over this text, and release it. Fail if this text does not change.<\\\/p>");\
	document.write("<p><iframe src=\\""+location.href+"\\"><\\\/iframe><\\\/p>");\
} else {\
	document.write("<div draggable=\\"true\\"><\\\/div>");\
	document.getElementsByTagName("div")[0].ondragstart = function (e) {\
		e.dataTransfer.effectAllowed = "copy";\
		e.dataTransfer.setData("text","dummy text");\
		e.dataTransfer.allowTargetOrigin("*");\
	};\
}\
		<\/script>\
	<\/body>\
<\/html>'));

		</script>
	</body>
</html>