Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html |
| diff --git a/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html b/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6a6ada6634f65887bfa60d83d0551443e6f7c2cb |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html |
| @@ -0,0 +1,23 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<style> |
| +#target { |
| + background: var(--inherited-color); |
| + color: var(--non-inherited-color); |
| +} |
| +</style> |
| +<div id=target></div> |
| +<script> |
| +CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue: 'pink', inherits: true}); |
| +CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialValue: 'purple'}); |
| + |
| +test(function() { |
| + computedStyle = getComputedStyle(target); |
| + assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'pink'); |
|
Timothy Loh
2016/12/06 05:11:27
The discrepancy pink vs rgb().. is tracked in bug
|
| + assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'purple'); |
| + |
| + assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)'); |
| + assert_equals(computedStyle.color, 'rgb(128, 0, 128)'); |
| +}, "Initial values of registered properties can be referenced when no custom properties are explicitly set."); |
| +</script> |