Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<title>CSS Values and Units Test: Explicitly testing for the initial value of a custom property</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div>
PASS if green
</div>
<style>
div {
color: if(style(--x:initial): green; else: red);
}
</style>
<script>
test(() => {
let cs = getComputedStyle(document.querySelector('div'));
assert_equals(cs.getPropertyValue('color'), 'rgb(0, 128, 0)');
}, 'if-testing the initial keyword without any property registrations');
</script>