function getScrollBorders() {
      var scrollTop = typeof(window.pageYOffset) == 'number' ?
          window.pageYOffset : document.documentElement.scrollTop;
      var scrollLeft = typeof(window.pageXOffset) == 'number' ?
          window.pageXOffset : document.documentElement.scrollLeft;

      return [scrollTop, scrollLeft + width, scrollTop + height, scrollLeft];
    }
Returns the top, right, bottom and left positions of the viewport
borders that should trigger scrolling when the selection box is dragged
close to them.

@return {!Array.<number>} Positions of the scrolling viewport borders,
    respectively in the following order: top, right, bottom, left. All
    positions are relative to the top-left corner of the document.