contentScroller = function(el) {

    var containerDimensions = $(el).data(pluginName).containerDimensions;

    /**
     * Returns the available distance the selection container viewport can
     * still be scrolled before reaching the selection container margins.
     *
     * @return {!Array.<number>} Available scrolling distances, respectively
     *     from the following borders: top, right, bottom, left.
     */
    function getScrollableDistances() {
      return [
        el.scrollTop,
        el.scrollWidth - el.scrollLeft - containerDimensions.width,
        el.scrollHeight - el.scrollTop - containerDimensions.height,
        el.scrollLeft
      ];
    }

    /**
     * Scrolls the selection container viewport by the required amount.
     *
     * @param {string} scrollAxis The scrolling axis, either 'vertical' or
     *     'horizontal'.
     * @param {number} shift The scrolling amount, in pixels. If positive the
     *     scrolling direction should be downward / rightward. If negative,
     *     upward / leftward.
     */
    function scroll(scrollAxis, shift) {
      var property = scrollAxis == 'vertical' ? 'scrollTop' : 'scrollLeft';
      el[property] += shift;
    }

    /**
     * Returns the offset, in pixels, that should be added to selectable
     * elements' positions (as computed by the plugin 'positioner'), to take
     * into account scrolling.
     *
     * This is not relevant when native browser scrolling is used, but comes
     * into play when scrolling is emulated via container offsets (for Google
     * Maps-like scrolling behavior).
     *
     * @return {!Object.<string, number>} An object containing the 'top' and
     *     'left' properties, pointing respectively to the top and left offset
     *     to add.
     */
    function getScrollOffset() {
      return {top: 0, left: 0};
    }

    return {
      getScrollableDistances: getScrollableDistances,
      scroll: scroll,
      getScrollOffset: getScrollOffset
    };
  }
Content scroller. It scrolls the selection container viewport using
native browser scrolling mechanisms whenever the selection box comes
close to the viewport borders and the selectable content overflows the
selection container viewport.

@param {!Element} el The selection container, i.e. the element to which the
    plugin is applied to.