summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/dropzone
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/editing/dnd/dropzone
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/editing/dnd/dropzone')
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/007.html54
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/008.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/009.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/010.html16
10 files changed, 292 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml
new file mode 100644
index 000000000..4fc405af3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: copy</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<div dropzone="copy string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+<p>You should be able to drag selection to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml
new file mode 100644
index 000000000..87a64b3ee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: move</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+<div dropzone="move string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+<p>You should be able to drag selection to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml
new file mode 100644
index 000000000..7683b1c17
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: link</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body>
+<p><a href="data:text/plain,1">Drag me</a></p>
+<div dropzone="link string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'))"/>
+<p>You should be able to drag link to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml
new file mode 100644
index 000000000..683956899
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'link','copyLink','linkMove' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['link','copyLink','linkMove','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'link' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="link string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml
new file mode 100644
index 000000000..5cdba423f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'copy','copyMove','copyLink' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','copyMove','copyLink','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="copy string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml
new file mode 100644
index 000000000..eb5da24fc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'move','copyMove','linkMove' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['move','copyMove','linkMove','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'move' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="move string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/007.html b/testing/web-platform/tests/html/editing/dnd/dropzone/007.html
new file mode 100644
index 000000000..3140e768f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/007.html
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropzone should not affect the dropEffect seen by dragenter and dragover</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;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ var drop = document.getElementsByTagName('div')[1], dragenter, dragover;
+ drop.ondragenter = function (e) {
+ dragenter = e.dataTransfer.dropEffect;
+ };
+ drop.ondragover = function (e) {
+ dragover = e.dataTransfer.dropEffect;
+ };
+ drop.ondrop = function (e) {
+ var sequence = ([dragenter,dragover,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['copy','copy','link']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/008.html b/testing/web-platform/tests/html/editing/dnd/dropzone/008.html
new file mode 100644
index 000000000..a82813c04
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/008.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropzone should not affect the dropEffect if dragover is cancelled</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;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ var drop = document.getElementsByTagName('div')[1], dragenter, dragover;
+ drop.ondragenter = function (e) {
+ dragenter = e.dataTransfer.dropEffect;
+ e.preventDefault();
+ };
+ drop.ondragover = function (e) {
+ dragover = e.dataTransfer.dropEffect;
+ e.preventDefault();
+ };
+ drop.ondrop = function (e) {
+ var sequence = ([dragenter,dragover,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['copy','copy','copy']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/009.html b/testing/web-platform/tests/html/editing/dnd/dropzone/009.html
new file mode 100644
index 000000000..cc94dba03
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/009.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping selection onto dropzone with JS disabled</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Disable JavaScript</li>
+ <li>Select some text in this sentence.</li>
+ <li dropzone="copy string:text/plain">Drag the selection over this text.</li>
+ <li>If supported by the platform, the mouse cursor should show the drop-allowed cursor.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/010.html b/testing/web-platform/tests/html/editing/dnd/dropzone/010.html
new file mode 100644
index 000000000..ff787b829
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/010.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping selection onto dropzone with no padding</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Select some text in this sentence.</li>
+ <li dropzone="copy string:text/plain" ondrop="this.parentNode.getElementsByTagName('li')[2].textContent='PASS';">Drag the selection over this text and release it.</li>
+ <li>This text should change.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file