dropzone_attribute.html (2094B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset='utf-8'> 5 <title>HTML Test: dropzone_attribute</title> 6 <link rel='author' title='Intel' href='http://www.intel.com'> 7 <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'> 8 <meta name="flags" content="may"> 9 <script src='/resources/testharness.js'></script> 10 <script src='/resources/testharnessreport.js'></script> 11 </head> 12 13 <body> 14 <div id='log'> </div> 15 16 <script> 17 var drop_element; 18 19 setup(function() { drop_element = document.createElement('div'); }); 20 21 test(function() { 22 //Empty values for elements 23 drop_element.dropzone = ''; 24 assert_not_equals(drop_element.dropzone, undefined, 'div.dropzone should not be undefined if it\'s been set'); 25 }, 'div.dropzone should not be undefined if it\'s been set'); 26 27 test(function() { 28 drop_element.dropzone = null; 29 assert_not_equals(drop_element.dropzone, null, 'div.dropzone should not be null'); 30 }, 'div.dropzone should not be null'); 31 32 test(function() { 33 //The dropzone IDL attribute must reflect the content attribute of the same name. 34 drop_element.setAttribute('dropzone', 'copy file:image/png file:image/gif file:image/jpeg'); 35 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'); 36 }, 'div dropzone idl attribute must reflect the content attribute of the same name'); 37 38 test(function() { 39 //The dropzone content attribute is set to the literal value when the idl attribute value is set. 40 drop_element.dropzone = 'copy file:image/png file:image/gif file:image/jpeg'; 41 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'); 42 }, 'div dropzone content attribute is set to the literal value'); 43 </script> 44 </body> 45 </html>