allyContainedChild
  && (isText(lastPartiallyContainedChild)
  || lastPartiallyContainedChild.nodeType == Node.COMMENT_NODE
  || lastPartiallyContainedChild.nodeType == Node.PROCESSING_INSTRUCTION_NODE)) {
    // "Let clone be the result of calling cloneNode(false) on original
    // end node."
    var clone = originalEndNode.cloneNode(false);

    // "Set the data of clone to the result of calling substringData(0,
    // original end offset) on original end node."
    clone.data = originalEndNode.substring