Re: [csswg-drafts] [cssom-view] Specify document.caretPositionFromPoint in shadow DOM scenario (#9932)

The CSS Working Group just discussed `[cssom-view] Specify document.caretPositionFromPoint in shadow DOM scenario`, and agreed to the following:

* `RESOLVED: add shadowRoots parameter to caretPositionFromPoint, same as getComposedRanges`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Liu: This API is defined in cssom-view, and spec doesn't have a definition for behavior in shadow DOM<br>
&lt;fantasai> Liu: Existing behavior is [missed]<br>
&lt;fantasai> Liu: Other alternatives are to not pierce shadow DOM<br>
&lt;fantasai> Liu: Another approach is to add a new parameter with set of shadow roots, and will return positio inside the shadow roots<br>
&lt;fantasai> Liu: Gathered feedback from community, and preference is to add parameter and only pierce the specified shadow roots<br>
&lt;fantasai> Liu: If this is acceptable, should we adopt?<br>
&lt;fantasai> Liu: Firefox's implementation is that the API can pierce the shadow tree, and tree can be open or closed shadow tree<br>
&lt;fantasai> mfreed: I'm definitely not a fan of revealing contents of shadow trees, particularly closed ones<br>
&lt;fantasai> mfreed: I heard proposed to use getComposedRanges behavior, where if you don't know about the shadow tree you get the shadow host<br>
&lt;dandclark> q+<br>
&lt;sanketj_> q+<br>
&lt;fantasai> astearns: I'm not familiar with these APIs. Is getComposedRanges same pattern as what's proposed here?<br>
&lt;fantasai> mfreed: Yes. parameters to say which you know about, and it will pierce those, and give you host for those that you don't<br>
&lt;astearns> ack dandclark<br>
&lt;fantasai> dandclark: getComposedRanges spec link dropped in the issue doesn't take a parameter<br>
&lt;fantasai> dandclark: do browsers implement something else?<br>
&lt;fantasai> mfreed: It's only implemented in WebKit, definitely not in Blink yet<br>
&lt;fantasai> astearns: Looking at WebIDL there's a parameter, just not in description<br>
&lt;fantasai> dandclark: OK<br>
&lt;astearns> ack sanketj_<br>
&lt;dholbert> q+<br>
&lt;fantasai> sanketj_: Seems that Firefox is only one that pierces closed shadow tree, so getComposedRanges addresses that, so +1<br>
&lt;astearns> ack dholbert<br>
&lt;fantasai> dholbert: With this version of the API, that takes list of shadow roots to pierce, if web developer listed every shadow root in their page they would get existing Firefox behavior?<br>
&lt;fantasai> mfreed: yes, but not possible if you don't have reference to the shadow root you can't provide it<br>
&lt;fantasai> mfreed: so e.g. closed shadow root, unless you set it up, you can't get it<br>
&lt;fantasai> astearns: wrt the spec descriptions, the descriptions don't mention parameters, but the algorithms do process them<br>
&lt;fantasai> astearns: Sounds like we're ready to resolve? Any additional comments?<br>
&lt;fantasai> astearns: Proposed resolution is that caretPositionFromPoint can follow the getComposedRanges behavior and have a shadowRoots parameter<br>
&lt;fantasai> RESOLVED: add shadowRoots parameter to caretPositionFromPoint, same as getComposedRanges<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9932#issuecomment-2035793983 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 3 April 2024 23:16:24 UTC