OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <style> | 5 <style> |
6 #inner { | 6 #inner { |
7 --length: 10px; | 7 --length: 10px; |
8 --color: red; | 8 --color: red; |
9 } | 9 } |
10 #outer { | 10 #outer { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 assert_equals(inlineStyle.getPropertyValue('--color'), ''); | 60 assert_equals(inlineStyle.getPropertyValue('--color'), ''); |
61 assert_equals(computedStyle.getPropertyValue('--length'), '10px'); | 61 assert_equals(computedStyle.getPropertyValue('--length'), '10px'); |
62 assert_equals(computedStyle.getPropertyValue('--color'), 'red'); | 62 assert_equals(computedStyle.getPropertyValue('--color'), 'red'); |
63 }, "Values can be removed from inline styles"); | 63 }, "Values can be removed from inline styles"); |
64 | 64 |
65 test(function() { | 65 test(function() { |
66 sheetStyle.setProperty('--length', 'banana'); // Invalid, no change | 66 sheetStyle.setProperty('--length', 'banana'); // Invalid, no change |
67 assert_equals(computedStyle.getPropertyValue('--length'), '10px'); | 67 assert_equals(computedStyle.getPropertyValue('--length'), '10px'); |
68 sheetStyle.setProperty('--length', '20px'); | 68 sheetStyle.setProperty('--length', '20px'); |
69 assert_equals(computedStyle.getPropertyValue('--length'), '20px'); | 69 assert_equals(computedStyle.getPropertyValue('--length'), '20px'); |
| 70 sheetStyle.setProperty('--length', 'initial'); |
| 71 assert_equals(computedStyle.getPropertyValue('--length'), '0px'); |
70 }, "Stylesheets can be modified by CSSOM"); | 72 }, "Stylesheets can be modified by CSSOM"); |
71 | 73 |
72 test(function() { | 74 test(function() { |
73 inlineStyle.setProperty('--length', '30px'); | 75 inlineStyle.setProperty('--length', '30px'); |
74 inlineStyle.setProperty('--color', 'pink'); | 76 inlineStyle.setProperty('--color', 'pink'); |
75 assert_equals(inlineStyle.getPropertyValue('--length'), '30px'); | 77 assert_equals(inlineStyle.getPropertyValue('--length'), '30px'); |
76 assert_equals(inlineStyle.getPropertyValue('--color'), 'pink'); | 78 assert_equals(inlineStyle.getPropertyValue('--color'), 'pink'); |
77 assert_equals(computedStyle.getPropertyValue('--length'), '30px'); | 79 assert_equals(computedStyle.getPropertyValue('--length'), '30px'); |
78 assert_equals(computedStyle.getPropertyValue('--color'), 'pink'); | 80 assert_equals(computedStyle.getPropertyValue('--color'), 'pink'); |
| 81 inlineStyle.setProperty('--color', 'inherit'); |
| 82 assert_equals(inlineStyle.getPropertyValue('--color'), 'inherit'); |
| 83 assert_equals(computedStyle.getPropertyValue('--color'), 'blue'); |
79 }, "Valid values can be set on inline styles"); | 84 }, "Valid values can be set on inline styles"); |
80 </script> | 85 </script> |
OLD | NEW |