I've spent some time searching SO for mapping mouse coordinates to text offset (for drag and drop), but the only solution I've come across is to wrap each character in its own span so that you may monitor mouse events on that span, which is not a scalable solution (for large documents).
But moreover, Google Docs is able to track the mouse cursor as it drags text around (drawing an insertion point in the text where the mouse is). From monitoring the DOM at and around the text, it doesn't appear to be using the character-span technique. Does anyone know how this is accomplished?