webkit-appearance-property.html (3163B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Property references to `-webkit-appearance`</title> 6 <link rel="help" href="https://drafts.csswg.org/css-ui-4/#appearance-switching"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 </head> 10 <body> 11 <script> 12 function create(initialValue) { 13 var style = document.createElement('input').style; 14 15 style.setProperty('appearance', initialValue); 16 17 return style; 18 } 19 20 test(function() { 21 var style = create(''); 22 23 style.setProperty('-webkit-appearance', 'none'); 24 25 assert_equals(style.appearance, 'none'); 26 }, 'setProperty - CSS property name'); 27 28 test(function() { 29 var style = create(''); 30 31 style.setProperty('WebkitAppearance', 'none'); 32 33 assert_equals(style.appearance, ''); 34 }, 'setProperty - camel-cased property name (ignored)'); 35 36 test(function() { 37 var style = create(''); 38 39 style.setProperty('webkitAppearance', 'none'); 40 41 assert_equals(style.appearance, ''); 42 }, 'setProperty - webkit-cased property name (ignored)'); 43 44 test(function() { 45 var style = create('none'); 46 47 style.removeProperty('-webkit-appearance'); 48 49 assert_equals(style.appearance, ''); 50 }, 'removeProperty - CSS property name'); 51 52 test(function() { 53 var style = create('none'); 54 55 style.removeProperty('WebkitAppearance'); 56 57 assert_equals(style.appearance, 'none'); 58 }, 'removeProperty - camel-cased property name (ignored)'); 59 60 test(function() { 61 var style = create('none'); 62 63 style.removeProperty('webkitAppearance'); 64 65 assert_equals(style.appearance, 'none'); 66 }, 'removeProperty - webkit-cased property name (ignored)'); 67 68 test(function() { 69 var style = create(''); 70 71 style['-webkit-appearance'] = 'none'; 72 73 assert_equals(style.appearance, 'none'); 74 }, 'property assignment - CSS property name'); 75 76 test(function() { 77 var style = create(''); 78 79 style['WebkitAppearance'] = 'none'; 80 81 assert_equals(style.appearance, 'none'); 82 }, 'property assignment - camel-cased property name'); 83 84 test(function() { 85 var style = create(''); 86 87 style['webkitAppearance'] = 'none'; 88 89 assert_equals(style.appearance, 'none'); 90 }, 'property assignment - webkit-cased property name'); 91 92 test(function() { 93 var style = create('none'); 94 95 assert_equals(style.getPropertyValue('-webkit-appearance'), 'none'); 96 }, 'getPropertyValue - CSS property name'); 97 98 test(function() { 99 var style = create('none'); 100 101 assert_equals(style.getPropertyValue('WebkitAppearance'), ''); 102 }, 'getPropertyValue - camel-cased property name (ignored)'); 103 104 test(function() { 105 var style = create('none'); 106 107 assert_equals(style.getPropertyValue('webkitAppearance'), ''); 108 }, 'getPropertyValue - webkit-cased property name (ignored)'); 109 110 test(function() { 111 var style = create('none'); 112 113 assert_equals(style['-webkit-appearance'], 'none'); 114 }, 'property access - CSS property name'); 115 116 test(function() { 117 var style = create('none'); 118 119 assert_equals(style['WebkitAppearance'], 'none'); 120 }, 'property access - camel-cased property name'); 121 122 test(function() { 123 var style = create('none'); 124 125 assert_equals(style['webkitAppearance'], 'none'); 126 }, 'property access - webkit-cased property name'); 127 </script> 128 </body>