Using JavaScript, I would like to create a collapsed range from a pixel position, in order to insert new nodes in the flow of the document, after the range identified by this position.
This can be done with the TextRange object in Internet Exporer (moveToPoint(x, y) method).
How can I do this in FireFox & Webkit?
I can get the container element from the position with document.elementFromPoint(x, y). But when the position happens to be inside a text node, how do I get more information about the text offset required to build a range?