code: function getBBox(element, window) {
    const rect = element.getBoundingClientRect(),
      bBox = {left: rect.left, top: rect.top,
        right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height};
    if (window) {
      bBox.left += window.pageXOffset;
      bBox.right += window.pageXOffset;
      bBox.top += window.pageYOffset;
      bBox.bottom += window.pageYOffset;
    }
    return bBox;
  }
docs: An object that simulates `DOMRect` to indicate a bounding-box.
  @typedef {Object} BBox
  @property {(number|null)} left - document coordinate
  @property {(number|null)} top - document coordinate
  @property {(number|null)} right - document coordinate
  @property {(number|null)} bottom - document coordinate
  @property {(number|null)} width
  @property {(number|null)} height
   
  Get an element's bounding-box that contains coordinates relative to the element's document or window.
  @param {Element} element - Target element.
  @param {Window} [window] - Whether it's relative to the element's window, or document.
  @returns {(BBox|null)} A bounding-box or null when failed.