summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/datastore/055.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/editing/dnd/datastore/055.html')
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/055.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/055.html b/testing/web-platform/tests/html/editing/dnd/datastore/055.html
new file mode 100644
index 0000000000..ac2e64ed35
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/055.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+ <head>
+ <title>text/uri-list conversion</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], fails = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('url','http://example.com/');
+ if( !e.dataTransfer.getData('url') ) {
+ document.getElementsByTagName('p')[0].innerHTML = "FAIL - getData('url') returned nothing";
+ } else if( e.dataTransfer.getData('url') != e.dataTransfer.getData('text/uri-list') ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - text/uri-list is not the same as url';
+ } else {
+
+ e.dataTransfer.setData('url','#foo\r\n http://example.com/#bar \r\n http://example.org/');
+ if( e.dataTransfer.getData('url') != 'http://example.com/#bar' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - only the first URL should be returned - "'+e.dataTransfer.getData('url')+'"';
+ } else if( e.dataTransfer.getData('text/uri-list') != '#foo\r\n http://example.com/#bar \r\n http://example.org/' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - text/uri-list should return the full data';
+ } else {
+
+ e.dataTransfer.setData('url',' ');
+ if( e.dataTransfer.getData('url') ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - space was not a valid URL so an empty string should have been returned';
+ } else {
+ document.getElementsByTagName('p')[0].innerHTML = 'PASS';
+ }
+
+ }
+
+ }
+ e.preventDefault();
+ };
+};
+ </script>
+ </head>
+ <body>
+ <div draggable="true"></div>
+ <p>Attempt to drag the orange square.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html>