       else NodeFilter.SHOW_ALL
 
     document.createTreeWalker(tree, whatToShow, usingFilter, expandEntityReferences is true)
-
-html = document.documentElement
-match = html.matchesSelector ? html.webkitMatchesSelector ? html.msMatchesSelector ? html.mozMatchesSelector

    handler

  triggerEvent: (eventName, {onElement, bubbles, cancelable} = {}) ->
    element = onElement ? document.documentElement
    bubbles = bubbles isnt false
    cancelable = cancelable isnt false


html = document.documentElement
match = html.matchesSelector ? html.webkitMatchesSelector ? html.msMatchesSelector ? html.mozMatchesSelector

Trix.DOM = dom =
  handleEvent: (eventName, {onElement, matchingSelector, withCallback, inPhase, preventDefault} = {}) ->
    element = onElement ? html
    selector = matchingSelector
    callback = withCallback
    useCapture = inPhase is "capturing"
