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/crashtests/cancel-update.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<title>Check that cancelling one running animation and updating another doesn't
crash.</title>
<style>
  @keyframes anim {
    from { background-color: blue; }
    to { background-color: red; }
  }
  @keyframes anim2 {
    from { opacity: 0; }
    to { opacity: 1; }
  }
</style>
<div id="target"></div>
<script>
  window.onload = () => {
    target.style.animation = "anim 1s, anim2 1s";
    target.offsetTop;
    target.style.animation = "anim2 2s";
    target.offsetTop;
  };
</script>