   # Elements with `overflow: hidden` should not be scrolled.
   return false if computedStyle.getPropertyValue("overflow-#{direction}") == "hidden"
   # Non-visible elements should not be scrolled.
-  return false if ["hidden", "collapse"].indexOf(computedStyle.getPropertyValue("visibility")) != -1
+  return false if computedStyle.getPropertyValue("visibility") in ["hidden", "collapse"]
   return false if computedStyle.getPropertyValue("display") == "none"
   true
 

    unless settings.get "smoothScroll"
      return performScroll element, axisName, amount

    if mostRecentActivationId == time or lastEvent?.repeat
      # Either the most-recently activated animator has not yet received its keyup event (so it's still
      # scrolling), or this is a keyboard repeat (for which we don't initiate a new animator).  We need both
      # of these checks because sometimes (perhaps one time in twenty) the last keyboard repeat arrives
      # *after* the corresponding keyup.
      return

    mostRecentActivationId = activationId = ++time

    duration = 100 # Duration in ms.
    fudgeFactor = 25

    # Allow a bit longer for longer scrolls.
    duration += fudgeFactor * Math.log Math.abs amount

    # Round away from 0, so that we don't leave any scroll amount unscrolled.
    roundOut = if 0 <= amount then Math.ceil else Math.floor
    delta = roundOut(amount / duration)


    scrolledAmount = 0

    shouldStopScrolling = (progress) ->
      # If activationTime == time, then this is the most recently-activated animator and we haven't yet seen
      # its keyup event, so keep going; otherwise, check progress and duration.
      if activationTime == time then false else duration <= progress

    animate = (timestamp) ->
      start ?= timestamp
