     xpath
 
   # This method is called recursively, to collect all the paths in a given sub-tree of the DOM.
-  collectPathsForNode: (node) ->
+  collectPathsForNode: (node, invisible = false) ->
     # Step one: get rendered node content, and store path info, if there is valuable content
     cont = @getNodeContent node, false
     if cont.length


  USE_THEAD_TBODY_WORKAROUND = true
  USE_TABLE_TEXT_WORKAROUND = true
  CONTEXT_LEN = 32

  @instances: []

        content: cont
        length: cont.length
        node : node
      if invisible
        console.log "Something seems to be wrong. I see visible content @ " + path + ", while some of the ancestor nodes reported empty contents. Probably a new selection API bug...."
    else
      invisible = true

    # Step two: cover all children.
    # Q: should we check children even if the goven node had no rendered content?
    # A: I seem to remember that the answer is yes, but I don't remember why.
    if node.hasChildNodes()
      for child in node.childNodes
        @collectPathsForNode child, invisible
    null

  getBody: -> (@rootWin.document.getElementsByTagName "body")[0]
