title: Web Speech crashes Safari iOS
body: <p>I'm working with speech synthesis in Mobile Safari and have found it to be very unstable, specifically when the DOM is being manipulated during the speaking.  I created a simple test case that crashes Safari (or a Webview) on iOS 7.1.1 on an iPad (but runs fine on OS X Safari).  Does anyone have any idea why the following HTML page would kill mobile Safari?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Speech Bug&lt;/title&gt;
      &lt;script&gt;
      function testFunc()
      {
          var elem = document.getElementById("textout");
          var wordCount = 0, utterance = new SpeechSynthesisUtterance("You'll notice that Safari on iOS will crash after clicking this button several times.");
  
          utterance.onstart = function(event) {
              elem.innerHTML = "";
          }
          utterance.onboundary = function (event) {
              elem.innerHTML += ++wordCount + "\n";
              elem.scrollTop = wordCount * 22;
          }
  
          window.speechSynthesis.speak(utterance);
      }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="textout" style="white-space: pre; font-size: 14pt; height: 100px; width: 50px; overflow: auto"&gt;&lt;/div&gt;
      &lt;button onclick="testFunc()"&gt;Click to Fail&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>