       if 0 < @endOffset < @endContainer.length
         if @startContainer is @endContainer
           @commonAncestorContainer = @endContainer.parentNode
-          @endContainer = @endContainer.splitText(@endOffset)
+          @endContainer = splitText(@endContainer, @endOffset)
 
           if @endOffset <= @startOffset
             @startContainer = @endContainer


          @startOffset = 0
        else
          @startContainer = @startContainer.splitText(@startOffset)
          @startOffset = 0

  # Public: Normalize the start and end to TextNode boundaries.


          @endOffset = 0
        else
          @endContainer = splitText(@endContainer, @endOffset)
          @endOffset = 0

    if @startContainer.nodeType is TEXT_NODE
