title: Event loop - Infinte loop won't stop rendering pipeline in Chrome but it will on Firefox
body: <p>In the following codepen the "stop earth" button initiates an infinite loop.</p>
  
  <p>I was expecting that the loop will prevent the browser from initating the rendering pipieline but I was surprised to see that in Chrome the gif continues smoothly.</p>
  
  <p>When testing this on Firefox the gif stops immediately.</p>
  
  <p><a href="https://codepen.io/amirnamdar-the-scripter/pen/NWPeRNY" rel="nofollow noreferrer">https://codepen.io/amirnamdar-the-scripter/pen/NWPeRNY</a></p>
  
  <pre><code>&lt;script&gt; 
  function stop() {
  while (true);
  }
  &lt;/script&gt;
  
  &lt;body&gt;
      &lt;h1&gt; Think you can stop the earth from spinning? &lt;/h1&gt;
      &lt;h2&gt;Hit the button&lt;/h2&gt;
  
      &lt;button onclick="stop()" &gt; stop earth &lt;/button&gt;
      &lt;img src="https://media.giphy.com/media/ux6AQI6MBwGqY/giphy.gif" width="480" height="270"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I assume that this might have something to do with the different implementations of the event loop in the different engines.</p>
  
  <p><strong>I'm curious about what V8 does differently than SpiderMonkey that results in this difference.</strong></p>
  
  <p>Thanks</p>