<!DOCTYPE html>
<html>
<body>
Test that target conditions are correctly removed on document destruction.<br/>
This test passes if it does not crash<br/>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
  <path id="path"></path>
  <use xlink:href="#path">
    <animateMotion begin="click"></animateMotion>
  </use>
</svg>
<script type="text/javascript">
  if (window.testRunner)
    testRunner.waitUntilDone();

  window.setTimeout(function(){
    if (location.hash != '#5') {
      if (window.GCController)
        window.GCController.collect();
      else if (window.gc)
        gc();
      if (location.hash == '')
        location.hash = '#1';
      else
        location.hash = "#" + (parseInt(location.hash.slice(1)) + 1).toString();
      location.reload();
    } else {
      document.write('PASS: Test did not crash.');
      if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.notifyDone();
      }
    }
  }, 0);
</script>
</body>
</html>