 
     mappings
 
+  # Return the rendered value of a part of the dom.
+  # If path is not given, the default path is used.
   getContentForPath: (path = null) -> 
     path ?= @getDefaultPath()       
     @allPaths[path].content
 
+  # Return the length of the rendered value of a part of the dom.
+  # If path is not given, the default path is used.
   getLengthForPath: (path = null) ->
     path ?= @getDefaultPath()
     @allPaths[path].length
 
+  # Return a given range of the rendered value of a part of the dom.
+  # If path is not given, the default path is used.
   getContentForRange: (start, end, path = null) ->
     @getContentForPath(path).substr start, end - start
 
   # Get the context that encompasses the given text range
+  # in the rendered text of the document
   getContextForRange: (start, end) ->
     content = @getContentForPath()
     prefixStart = Math.max 0, start - CONTEXT_LEN

      delete result.pathInfo.node
    result

  # Get the matching DOM elements for a given set of text ranges
  # (Calles getMappingsForRange for each element in the givenl ist)
  getMappingsForRanges: (ranges, path = null) ->

      sn.scrollIntoViewIfNeeded()
    sel

  # Read and convert the text of the current selection.
  readSelectionText: (sel) ->
    sel or= @rootWin.getSelection()
    sel.toString().trim().replace(/\n/g, " ").replace /[ ][ ]+/g, " "

  # Read the "text content" of a sub-tree of the DOM by creating a selection from it
  getNodeSelectionText: (node, shouldRestoreSelection = true) ->
    if shouldRestoreSelection then @saveSelection()

    sel = @selectNode node
    text = @readSelectionText sel

    if shouldRestoreSelection then @restoreSelection()
    text
