Re: [whatwg/dom] Should Live Range expose endpoints inside a shadow tree? (Issue #1362)

dizhang168 left a comment (whatwg/dom#1362)

> But what happens currently if getRangeAt(0) range is modified so that its boundary points point to a subtree which doesn't have document as root? I'd expect the range to be removed from selection, and that is how I'd expect the range to work also if one tries to set its boundary points to point to shadow DOM.

Right now, the range boundary points will be collapsed at the new boundary point. The range will not be removed from the selection.
```
sel.setBaseAndExtent(container, 0, container, 3);
range = sel.getRangeAt(0);
range.setStart(shadowRoot.firstChild, 0);
console.log(sel.getRangeAt(0) == range); // returns true
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1362#issuecomment-2695822304
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1362/2695822304@github.com>

Received on Monday, 3 March 2025 23:45:01 UTC