<!doctype html>
<html class="test-wait">
<title>CSS Animations Test: Chrome crash when removing documentElement and @keyframes stylesheet</title>
<link rel="help" href="https://crbug.com/999522">
<style>
  @keyframes anim {
    from { color: pink }
    to { color: purple }
  }
  div {
    animation: notfound 1s;
  }
</style>
<div></div>
<script>
window.addEventListener('load', () => {
  document.body.offsetTop;
  document.querySelector("style").remove();
  // We need the root later to remove the test-wait class.
  const root = document.documentElement;
  document.documentElement.remove();

  // rAF to make sure that style runs.
  requestAnimationFrame(() => {
    root.classList.remove('test-wait');
  });
});
</script>