       # the combined length of the textNodes to that point exceeds or
       # matches the value of the offset.
       length = 0
-      for tn in $(node).textNodes()
+      for tn in Util.getTextNodes($(node))
         if (length + tn.nodeValue.length >= this[p + 'Offset'])
           range[p + 'Container'] = tn
           range[p + 'Offset'] = this[p + 'Offset'] - length

  #
  # Returns an Array of TextNode instances.
  textNodes: ->
    textNodes = $(this.commonAncestor).textNodes()
    [start, end] = [textNodes.index(this.start), textNodes.index(this.end)]
    # Return the textNodes that fall between the start and end indexes.
    $.makeArray textNodes[start..end]

      else
        origParent = $(node).parent()

      xpath = Util.xpathFromNode(origParent, root)[0]
      textNodes = Util.getTextNodes(origParent)

      # Calculate real offset as the combined length of all the
      # preceding textNode siblings. We include the length of the
