 
   regions_overlap: (start1, end1, start2, end2) -> start1 < end2 and start2 < end1
 
-#  lookUpNode: (path) ->
-#    doc = @rootNode.ownerDocument ? @rootNode
-#    results = doc.evaluate path, @rootNode, null, 0, null
-#    node = results.iterateNext()
+  lookUpNode: (path) ->
+    doc = @rootNode.ownerDocument ? @rootNode
+    results = doc.evaluate path, @rootNode, null, 0, null
+    node = results.iterateNext()
 
   # save the original selection
   saveSelection: ->

class window.DomTextMapper
  constructor: ->
    @setRealRoot()

  # ===== Public methods =======

  # Consider only the sub-tree beginning with the given node.
  # 

        endOffset: endOffset
        endInfo: endInfo
    }
#    console.log "Done collecting"
    result

  # ===== Private methods (never call from outside the module) =======

  timestamp: -> new Date().getTime()

  domChangedSince: (timestamp) ->
#    console.log "Has the DOM changed since " + timestamp + "?"
    if @lastDOMChange? and timestamp? then @lastDOMChange > timestamp else true
#    if @lastDOMChange? and timestamp?
#      console.log "We have a timestamp, checking..."
#      result = @lastDOMChange > timestamp
#      console.log result
#    else
#      console.log "We don't have a timestamp (or a reference), assuming it has changed."
#      true        

  domStableSince: (timestamp) -> not @domChangedSince timestamp

  getProperNodeName: (node) ->
    nodeName = node.nodeName
