     activatedElement ||= document.body
     return unless activatedElement
 
-    element = findScrollableElement activatedElement, direction, amount, factor
-    elementAmount = factor * getDimension element, direction, amount
-    CoreScroller.scroll element, direction, elementAmount
+    # Avoid the expensive scroll calculation if it will not be used.  This reduces costs during smooth,
+    # continuous scrolls, and is just an optimization.
+    unless CoreScroller.wouldNotInitiateScroll()
+      element = findScrollableElement activatedElement, direction, amount, factor
+      elementAmount = factor * getDimension element, direction, amount
+      CoreScroller.scroll element, direction, elementAmount
 
   scrollTo: (direction, pos) ->
     return unless document.body or activatedElement
     activatedElement ||= document.body
 
-    element = findScrollableElement activatedElement, direction, pos
+    element = findScrollableElement activatedElement, direction, pos, 1
     amount = getDimension(element,direction,pos) - element[scrollProperties[direction].axisName]
     CoreScroller.scroll element, direction, amount
 

        @keyIsDown = false
        @time += 1

  # Calibration fudge factors for continuous scrolling.  The calibration value starts at 1.0.  We then
  # increase it (until it exceeds @maxCalibration) if we guess that the scroll is too slow, or decrease it
  # (until it is less than @minCalibration) if we guess that the scroll is too fast.  The cutoff point for
  # which guess we make is @calibrationBoundary. We require: 0 < @minCalibration <= 1 <= @maxCalibration.
  minCalibration: 0.5 # Controls how much we're willing to slow scrolls down; smaller => more slow down.
  maxCalibration: 1.6 # Controls how much we're willing to speed scrolls up; bigger => more speed up.
  calibrationBoundary: 150 # Boundary between scrolls which are considered too slow, and those too fast.

  # Scroll element by a relative amount (a number) in some direction.
  scroll: (element, direction, amount) ->

      # The constants in the duration calculation, above, are chosen to provide reasonable scroll speeds for
      # distinct keypresses.  For continuous scrolls, some scrolls are too slow, and others too fast. Here, we
      # speed up the slower scrolls, and slow down the faster scrolls.
      if myKeyIsStillDown() and 75 <= totalElapsed and @minCalibration <= calibration <= @maxCalibration
        calibration *= 1.05 if 1.05 * calibration * amount < @calibrationBoundary # Speed up slow scrolls.
        calibration *= 0.95 if @calibrationBoundary < 0.95 * calibration * amount # Slow down fast scrolls.

      # Calculate the initial delta, rounding up to ensure progress.  Then, adjust delta to account for the
      # current scroll state.
      delta = Math.ceil amount * (elapsed / duration) * calibration
      delta = if myKeyIsStillDown() then delta else Math.max 0, Math.min delta, amount - totalDelta

      if delta and performScroll element, direction, sign * delta
        totalDelta += delta
        requestAnimationFrame animate
      else
        # We're done.
        checkVisibility element

    # Launch animator.
    requestAnimationFrame animate

Scroller =
  init: (frontendSettings) ->
