function scrollChunk() {
        var newPosition = calculateNewPosition();

        element.scrollTop = newPosition;

        if (scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd) {
          $$rAF(scrollChunk);
        }
      }
Animate the requested element's scrollTop to the requested scrollPosition with basic easing.
@param {!Element} element The element to scroll.
@param {number} scrollEnd The new/final scroll position.
@param {number=} duration Duration of the scroll. Default is 1000ms.