if-initial-unregistered.html (721B)
1 <!DOCTYPE html> 2 <title>CSS Values and Units Test: Explicitly testing for the initial value of a custom property</title> 3 <link rel="help" href="https://drafts.csswg.org/css-values-5/#if-notation"> 4 <link rel="help" href="https://issues.chromium.org/issues/428131125"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <div> 8 PASS if green 9 </div> 10 <style> 11 div { 12 color: if(style(--x:initial): green; else: red); 13 } 14 </style> 15 <script> 16 test(() => { 17 let cs = getComputedStyle(document.querySelector('div')); 18 assert_equals(cs.getPropertyValue('color'), 'rgb(0, 128, 0)'); 19 }, 'if-testing the initial keyword without any property registrations'); 20 </script>