chromium/third_party/blink/web_tests/animations/stability/animation-end-event-destroy-renderer.html

<head>
  <title>Destroy and Hide Element in Animation End Event</title>
  <style type="text/css" media="screen">
    .box {
      height: 100px;
      width: 100px;
      margin: 10px;
      background-color: blue;
      animation-duration: 0.2s;
    }

    @keyframes move {
      from { transform: translate(0px, 0px); }
      to { transform: translate(100px, 0px); }
    }
  </style>
  <script src="../../resources/testharness.js"></script>
  <script src="../../resources/testharnessreport.js"></script>
  <script type="text/javascript" charset="utf-8">
    var test = async_test("Tests element removal and hiding within the animationend event handler. Should not crash");
    var numDone = 0;
    function animationEnded()
    {
      ++numDone;
      if (numDone == 2) {
        if (window.GCController)
          GCController.collect();

        test.done();
      }
    }

    function startTest()
    {
      var box1 = document.getElementById('box1');
      box1.addEventListener('animationend', function() {
        box1.parentNode.removeChild(box1);
        animationEnded();
      }, false);
      box1.style.animationName = 'move';

      var box2 = document.getElementById('box2');
      box2.addEventListener('animationend', function() {
        box2.style.display = 'none';
        animationEnded();
      }, false);
      box2.style.animationName = 'move';
    }

    window.addEventListener('load', test.step_func(startTest), false);
  </script>
</head>
<div id="container">
  <div id="box1" class="box"></div>
  <div id="box2" class="box"></div>
</div>