This new API allows users to get current caret position from a given screen point. The API returns a CaretPosition object which represents the caret position indicating current text insertion point including the containing DOM node, caret's character offset, and the client rectangle of caret range. The API also supports get CaretPosition inside Shadow DOM. To get CaretPosition inside Shadow DOM, caller needs to provide reference to all the shadow roots that this API can pierce into.
document.caretPositionFromPoint API is in CSSOM View and is already implemented by Gecko. WebKit/Blink has similar document.caretRangeFromPoint API which returns a text range indicating the text insertion point. The existing API was in CSSOM View at the time it was implemented: https://bugs.webkit.org/show_bug.cgi?id=27046 http://web.archive.org/web/20090708002518/http://dev.w3.org/csswg/cssom-view/#the-documentview-interface The existing API was replaced by the new API later: https://hg.csswg.org/drafts/rev/4c7b6f843171. The switch happened around 2009 and we don't have the historical context about the decision. Given how long it has been since the spec was updated, we believe it's best that Blink complies with the spec so that future innovations with the API can be spec compliant and have lower interop/compat risk.