title: Strange behaviour with textarea autogrow and CSS box-sizing
body: <p>I'm trying to make an textarea autogrow with Javascript. The logic is fairly simple, and here is my working code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#message-box").on('keydown', function() {
    var scroll_height = $("#message-box").get(0).scrollHeight;
    $("#message-box").css('height', scroll_height + 'px');
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#message-box {
    border: 1px solid #cccccc;
    width: 400px;
    min-height: 100px;
    padding: 5px;
    overflow: hidden;
    box-sizing: border-box;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;textarea id="message-box"&gt;&lt;/textarea&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Everything works great, but when I remove the <code>box-sizing: border-box;</code> property, I see strange things. <strong>With each keydown event the textarea autogrows</strong>.</p>
  
  <p>What is the relation between textarea autogrowing and the <code>box-sizing</code> property ?</p>
  
  <p><strong><em>EDIT</em></strong>
  <br />See the demos here : <br /></p>
  
  <p>With the box-sizing property : <a href="http://52.90.45.189/aks/textarea-autogrow.html" rel="nofollow noreferrer">http://52.90.45.189/aks/textarea-autogrow.html</a></p>
  
  <p>Without the box-sizing property : <a href="http://52.90.45.189/aks/textarea-autogrow-no-border-box.html" rel="nofollow noreferrer">http://52.90.45.189/aks/textarea-autogrow-no-border-box.html</a></p>
  
  <p>I can understand that scrollHeight increases by 10px when box-sizing is removed. But why does the browser add an extra 10px <strong>each time</strong> when a key is pressed ? </p>