hunk.code_window:     // Fallback to 1 in case both values are `0`
       scaleX = rect.width / element.offsetWidth || 1;
       scaleY = rect.height / element.offsetHeight || 1;
     }
     return {
       width: round(rect.width / scaleX),
  
hunk.labels: keep replace replace keep keep keep keep
hunk.after_edit:     if (offsetWidth > 0) {
         scaleX = rect.width / offsetWidth || 1;
       }
       if (offsetHeight > 0) {
         scaleY = rect.height / offsetHeight || 1;
       }
  
hunk.file_path: src/dom-utils/getBoundingClientRect.js
hunk.type: replace
file: <!DOCTYPE html> <title>Basic Visual Test</title>
  
  <style>
    @import '/reset.css';
    html,
    body {
      height: 1500px;
    }
  
    #reference {
      position: relative;
      top: 150px;
      left: 150px;
      width: 200px;
      height: 200px;
      background-color: red;
      box-shadow: inset 0 0 0 1px black;
    }
  
    #popper {
      width: 100px;
      height: 100px;
      background-color: rebeccapurple;
      box-shadow: inset 0 0 0 1px black;
    }
  </style>
  
  <div style="position: relative;">
    <table>
      <tr>
        <td>
          cell
        </td>
        <td>
          cell
        </td>
        <td>
          <div style="position: relative">
            <div id="reference">Reference Box</div>
            <div id="popper">Popper Box</div>
          </div>
        </td>
      </tr>
    </table>
  </div>
  
  <script type="module">
    import { createPopper } from '../dist/popper.js';
    const reference = document.querySelector('#reference');
    const popper = document.querySelector('#popper');
  
    window.instance = createPopper(reference, popper, {
      placement: 'right',
    });
  </script>
  