Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <style> | |
| 5 #target { | |
| 6 background: var(--inherited-color); | |
| 7 color: var(--non-inherited-color); | |
| 8 } | |
| 9 </style> | |
| 10 <div id=target></div> | |
| 11 <script> | |
| 12 CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue : 'pink', inherits: true}); | |
| 13 CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialV alue: 'purple'}); | |
| 14 | |
| 15 test(function() { | |
| 16 computedStyle = getComputedStyle(target); | |
| 17 assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'pink'); | |
|
Timothy Loh
2016/12/06 05:11:27
The discrepancy pink vs rgb().. is tracked in bug
| |
| 18 assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'purp le'); | |
| 19 | |
| 20 assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)'); | |
| 21 assert_equals(computedStyle.color, 'rgb(128, 0, 128)'); | |
| 22 }, "Initial values of registered properties can be referenced when no custom pro perties are explicitly set."); | |
| 23 </script> | |
| OLD | NEW |