hunk.code_window:       ? getBoundingClientRect(offsetParent)
         : { left: 0, top: 0 };
     // We want all the scrolling containers only up to and including the
     // offsetParent
     const offsetScrollParentIndex = scrollParents.indexOf(offsetParent);
     const relevantScrollParents = scrollParents.slice(
       0,
       Math.max(0, scrollParents.indexOf(offsetParent)) + 1
     );
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.file_path: src/dom-utils/getRectRelativeToOffsetParent.js
hunk.type: replace
file: // @flow
  import getWindow from './getWindow';
  import getNodeName from './getNodeName';
  import { isHTMLElement } from './instanceOf';
  
  export default function getOffsetParent(element: Element) {
    const offsetParent = isHTMLElement(element) ? element.offsetParent : null;
    const window = getWindow(element);
  
    if (getNodeName(offsetParent) === 'body') {
      return window;
    }
  
    return offsetParent || window;
  }
  