summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute.html
blob: feb73eccfe7a2cdbaabd08bd006eb54300607e53 (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
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>HTML Test: dropzone_attribute</title>
    <link rel='author' title='Intel' href='http://www.intel.com'>
    <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
    <meta name="flags" content="may">
    <script src='/resources/testharness.js'></script>
    <script src='/resources/testharnessreport.js'></script>
  </head>

  <body>
    <div id='log'> </div>

    <script>
        var drop_element;

        setup(function() { drop_element = document.createElement('div'); });

        test(function() {
          //Empty values for elements
          drop_element.dropzone = '';
          assert_not_equals(drop_element.dropzone, undefined, 'div.dropzone should not be undefined if it\'s been set');
        }, 'div.dropzone should not be undefined if it\'s been set');

        test(function() {
          drop_element.dropzone = null;
          assert_not_equals(drop_element.dropzone, null,  'div.dropzone should not be null');
        }, 'div.dropzone should not be null');

        test(function() {
          //The dropzone IDL attribute must reflect the content attribute of the same name.
          drop_element.setAttribute('dropzone', 'copy file:image/png file:image/gif file:image/jpeg');
          assert_equals(drop_element.dropzone, 'copy file:image/png file:image/gif file:image/jpeg', 'div dropzone idl attribute must reflect the content attribute of the same name');
        }, 'div dropzone idl attribute must reflect the content attribute of the same name');

         test(function() {
          //The dropzone content attribute is set to the literal value when the idl attribute value is set.
          drop_element.dropzone = 'copy file:image/png file:image/gif file:image/jpeg';
          assert_equals(drop_element.getAttribute('dropzone'), 'copy file:image/png file:image/gif file:image/jpeg', 'div dropzone content attribute is set to the literal value');
        }, 'div dropzone content attribute is set to the literal value');
    </script>
  </body>
</html>