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

> The first example is [StaticRange](https://dom.spec.whatwg.org/#staticrange-valid) has a definition for valid, which specifies this StaticRange is invalid if nodes are in different tree. In the same time, getComposedRanges() would return invalid StaticRanges. Is this expected?

I see a few ways to solve this.
1. We keep StaticRange as is and change `getComposedRanges()` to return a list of new Interface `StaticComposedRange` where `Its start and end are in the same document.`

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

3. We change the StaticRange by adding a new read-only `composed` boolean property.
    If false, `Its start and end are in the same node tree. (default)`
    If true, `Its start and end are in the same document.`
where composed is determined by whether the boundary points of the range are in different tree scopes.

The same logic should also be applied for Range setEnd/setStart.

cc: @mfreed7 @rniwa @siliu1

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

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

Received on Tuesday, 23 July 2024 18:57:52 UTC