https://www.w3.org/TR/cssom-view-1/#dom-document-caretpositionfrompoint
WPT test cases fail in Safari 15.6 on macOS 12.5 - https://wpt.fyi/results/css/cssom?label=master&label=experimental&aligned&q=caretpositionfrompoint Only Firefox seems to pass them so far.
<rdar://problem/97760045>
seeAlso https://github.com/WebKit/standards-positions/issues/301
I found that it doesn't return the element within the shadow DOM and looked for a way to get it. There doesn't appear to be one yet. A shadowRoots parameter was added to the draft: https://github.com/w3c/csswg-drafts/pull/10200 https://github.com/w3c/csswg-drafts/blob/main/cssom-view-1/Overview.bs#L1018 https://drafts.csswg.org/cssom-view-1/#extensions-to-the-document-interface