-window.Scroller = root = {}
-
 #
 # activatedElement is different from document.activeElement -- the latter seems to be reserved mostly for
 # input elements. This mechanism allows us to decide whether to scroll a div or to scroll the whole document.
 #
 activatedElement = null
 settings = null
-
-root.init = (frontendSettings) ->
-  settings = frontendSettings
-  handlerStack.push DOMActivate: -> activatedElement = event.target
 
 scrollProperties =
   x: {

  before != after

# Find the element we should and can scroll.
findScrollableElement = (element, direction, amount, factor = 1) ->
  axisName = scrollProperties[direction].axisName
  while element != document.body and
    not (isScrollPossible(element, direction, amount, factor) and isScrollAllowed(element, direction))


# Test whether element should be scrolled.
isScrollAllowed = (element, direction) ->
  computedStyle = window.getComputedStyle(element)
  # Elements with `overflow: hidden` should not be scrolled.
  return computedStyle.getPropertyValue("overflow-#{direction}") != "hidden" and
         ["hidden", "collapse"].indexOf(computedStyle.getPropertyValue("visibility")) == -1 and
         computedStyle.getPropertyValue("display") != "none"

# Test whether element actually scrolls in the direction required when asked to do so.
# Due to chrome bug 110149, scrollHeight and clientHeight cannot be used to reliably determine whether an
