packages/fbjs/src/__forks__/Style.js
function(node) {
    if (!node) {
      return null;
    }
    var ownerDocument = node.ownerDocument;
    while (node && node !== ownerDocument.body) {
      if (_isNodeScrollable(node, 'overflow') ||
          _isNodeScrollable(node, 'overflowY') ||
          _isNodeScrollable(node, 'overflowX')) {
        return node;
      }
      node = node.parentNode;
    }
    return ownerDocument.defaultView || ownerDocument.parentWindow;
  }
function(node) {
    if (!node) {
      return null;
    }
    var ownerDocument = node.ownerDocument;
    while (node && node !== ownerDocument.body) {
      if (_isNodeScrollable(node, 'overflow') ||
          _isNodeScrollable(node, 'overflowY') ||
          _isNodeScrollable(node, 'overflowX')) {
        return node;
      }
      node = node.parentNode;
    }
    return ownerDocument.defaultView || ownerDocument.parentWindow;
  }
function ( node ) { if ( ! node ) { return null ; } var ownerDocument = node . ownerDocument ; while ( node && node !== ownerDocument . body ) { if ( _isNodeScrollable ( node , 'overflow' ) || _isNodeScrollable ( node , 'overflowY' ) || _isNodeScrollable ( node , 'overflowX' ) ) { return node ; } node = node . parentNode ; } return ownerDocument . defaultView || ownerDocument . parentWindow ; }
Determines the nearest ancestor of a node that is scrollable.

NOTE: This can be expensive if used repeatedly or on a node nested deeply.

@param {?DOMNode} node Node from which to start searching.
@return {?DOMWindow|DOMElement} Scroll parent of the supplied node.
Determines the nearest ancestor of a node that is scrollable .