Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: timelapse
Fetching contributors…

Cannot retrieve contributors at this time

file 70 lines (61 sloc) 1.846 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
<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;
      -webkit-animation-duration: 0.2s;
      -webkit-animation-iteration-count: 2;
    }
    
    @-webkit-keyframes move {
      from { -webkit-transform: translate(0px, 0px); }
      to { -webkit-transform: translate(100px, 0px); }
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    var numDone = 0;
    function animationIterated()
    {
      ++numDone;
      if (numDone == 2) {
        if (window.GCController)
          GCController.collect();

        document.getElementById('results').innerHTML = 'Did not crash, so PASSED';

        if (window.testRunner)
          testRunner.notifyDone();
      }
    }

    function startTest()
    {
      var box1 = document.getElementById('box1');
      box1.addEventListener('webkitAnimationIteration', function() {
        box1.parentNode.removeChild(box1);
        animationIterated();
      }, false);
      box1.style.webkitAnimationName = 'move';

      var box2 = document.getElementById('box2');
      box2.addEventListener('webkitAnimationIteration', function() {
        box2.style.display = 'none';
        animationIterated();
      }, false);
      box2.style.webkitAnimationName = 'move';
    }
    
    window.addEventListener('load', startTest, false);
  </script>
</head>
<body>

<p>Tests element removal and hiding within the webkitAnimationIteration event handler. Should not crash.</p>

<div id="container">
  <div id="box1" class="box"></div>
  <div id="box2" class="box"></div>
</div>
<div id="results"></div>
</body>
</html>
Something went wrong with that request. Please try again.