Re: [w3c/selection-api] Need spec changes to Range and StaticRange to support nodes in different tree? (Issue #169)

> * We change the StaticRange valid condition to `Its start and end are in the same document.`

I very much like this option. The whole point of the overall `getComposedRanges()` feature is to make the appropriate tweaks to the existing APIs to support shadow trees. If there's a natural way to do that with existing things (e.g. `StaticRange`) then we should just do that.

> The second example is `Range::SetStart` and `Range::SetEnd` would collapse nodes to one point if they are in different trees. Shouldn't we also loose this requirement since we are supporting selection across the boundary?

Same here - let's just make this work correctly. I went into this particular case in some detail in my explainer:

https://github.com/mfreed7/shadow-dom-selection?tab=readme-ov-file#mutability-of-live-ranges-returned-from-getrangeat



-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/selection-api/issues/169#issuecomment-2249009347
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/selection-api/issues/169/2249009347@github.com>

Received on Wednesday, 24 July 2024 22:37:09 UTC