summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustallow.html
blob: c0d3aa022ce39396f8519027c5074c2e43f13db5 (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
<!doctype html>
<html>
  <head>
    <title>Must be allowed</title>
    <style type="text/css">
html { background: blue; }
html, body { margin: 0; padding: 0; height: 100%; width: 100%; }
    </style>
  </head>
  <body>
    <script type="text/javascript">
if( location.search && location.search.indexOf('domain') != -1 ) {
  document.domain = location.hostname.replace(/^[^.]+\./,'');
}
var seentypes = {};
document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {
  e.preventDefault();
  if( e.type == 'drop' ) {
    document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover && e.dataTransfer.getData('text') == 'dummy text' ) ? 'PASS' : 'FAIL';
  } else {
    seentypes[e.type] = true;
  }
}
    </script>
  </body>
</html>