Open BenjaminAster opened 1 month ago
+1 to this proposal
I think this proposal should explicitly include supporting getting caret positions inside shadow DOM using the options
parameter (https://drafts.csswg.org/cssom-view-1/#dictdef-caretpositionfrompointoptions). That has been a popular ask from web developers, but Chromium is currently the only engine that implements that part of the spec.
There appear to be basically no tests in WPT for this?
Description
The
document.caretPositionFromPoint()
method is currently not implemented in WebKit. Instead, WebKit implements the non-standarddocument.caretRangeFromPoint()
method, which returns aRange
instead of aCaretPosition
. Note that Chromium also only recently added support for the standardized method.Specification
https://drafts.csswg.org/cssom-view-1/#dom-document-caretpositionfrompoint
Additional Signals
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=172137