Eliminate the use of lastChild in TextIterator