Contact emails
[email protected], [email protected]

Explainer
None

Specification
https://www.w3.org/TR/cssom-view-1/#dom-document-caretpositionfrompoint

Summary

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. 


Blink component
Blink>CSS 
<https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3ECSS>

Motivation

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.


Initial public proposal
None

TAG review
None

TAG review status
Not applicable

Risks


Interoperability and Compatibility

Gecko already implemented the API. Webkit/Blink didn't implement it. The 
interop risk is that it's unclear at this moment about Webkit's position on 
this. We won't be able to achieve full interop with this API if Webkit 
isn't willing to support this API. There is a compat risk too if we decided 
to deprecate the old API: https://crbug.com/690599


*Gecko*: Shipped/Shipping

*WebKit*: No signal (
https://github.com/WebKit/standards-positions/issues/301)

*Web developers*: Positive (
https://bugs.chromium.org/p/chromium/issues/detail?id=388976#c34) Web 
developers are asking to have document.caretPositionFromPoint API 
implemented in Blink: 
https://bugs.chromium.org/p/chromium/issues/detail?id=388976#c28 
https://bugs.chromium.org/p/chromium/issues/detail?id=388976#c34

*Other signals*:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that 
it has potentially high risk for Android WebView-based applications?

None


Debuggability

None


Is this feature fully tested by web-platform-tests 
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>
?
Yes

The API is tested in WPT: 
https://github.com/web-platform-tests/wpt/blob/c18cfd4eb319ca535db8c194941719598b3b6ea8/css/cssom/caretPositionFromPoint.html


Flag name on chrome://flags
None

Finch feature name
None

Non-finch justification
None

Requires code in //chrome?
False

Tracking bug
https://crbug.com/388976

Estimated milestones

No milestones specified


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5201014343073792

This intent message was generated by Chrome Platform Status 
<https://chromestatus.com/>.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2618db7c-56d2-4ff2-89c5-df65e1dfe6c7n%40chromium.org.

Reply via email to