summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/file/prompt/003.html
blob: ada495bd1936681af6df1eece7652f2411573aa0 (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
<!DOCTYPE html>
<title>drag &amp; drop - file drop prompt for ftp server name</title>
<style>
  body > div {
    height: 200px;
    width: 200px;
    background-color: orange;
  }
</style>

<script>
window.onload = function() {
  if( location.protocol != 'ftp:' ) {
    document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over ftp.';
    return;
  }
  var orange = document.getElementsByTagName('div')[0];
  orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
    e.preventDefault();
  };
  document.getElementsByTagName('span')[0].innerHTML = location.hostname;
};
</script>

<div></div>

<p>Drag a file from your desktop onto the orange square. A prompt should appear, correctly identifying the server name as <span></span></p>
<noscript><p>Enable JavaScript and reload</p></noscript>