Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-animations/keyframes-unrelated-custom-property.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<title>Unrelated custom properties do not conflict with each other</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
  @keyframes test {
    0% { --x: green; }
    100% { --x: green; }
    /* This should not affect the background-color of #div: */
    0% { --unused: yellow; }
  }
  #div {
    animation: test 10s linear paused;
    background-color: var(--x, red);
    width: 100px;
    height: 100px;
  }
</style>
<div id=div></div>
<script>
test(() => {
  assert_equals(getComputedStyle(div).backgroundColor, 'rgb(0, 128, 0)');
}, 'Unrelated custom properties do not conflict with each other');
</script>