title: Webkit bug: Overflow auto triggered after resizing a child element to matching size
body: <p>I have the following simple set-up:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>document.getElementById('inner').addEventListener('click', ({ target }) =&gt; {
    target.classList.add('match');
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#container {
    background: green;
    overflow: auto;
    width: 200px;
    height: 100px;
  }
  
  #inner {
    width: 210px;
    height: 110px;
  }
  
  #inner.match {
    width: 200px;
    height: 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;
    &lt;div id="inner"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Upon clicking the inner element, I'd expect the scrollbars on the parent to disappear since the two elements now have matching sizes. This works as expected in Firefox.<br>
  However the container element doesn't lose scrollbars in Chrome as can be seen in the below screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/DFoJk.png" alt="Sample image"></p>
  
  <p>The scrollbars themselves create an offset large enough to create overflowing.<br>
  Is this a webkit-specific issue? Is there a cross-browser, reliable solution to this (seemingly trivial) issue?  </p>
  
  <p>I'm looking for a solution that doesn't change the parent's properties as my content (<code>#inner</code>) will be placed in DOM I don't have control over.</p>
  
  <p>So far I've tried hiding/showing and/or detaching/reinserting the element at different points of execution, but the problem persists, likely because the operations are simply optimized away.  </p>
  
  <p>The issue occurs both in Jsfiddle and in the Stack snippet.</p>
  
  <p>The bug has been filed on <a href="https://bugs.webkit.org/show_bug.cgi?id=139629" rel="nofollow noreferrer">Webkit Bugzilla</a>.</p>