- From: Masayuki Nakano <notifications@github.com>
- Date: Tue, 03 Feb 2026 17:40:59 -0800
- To: w3c/selection-api <selection-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/selection-api/issues/99/3844754812@github.com>
masayuki-nakano left a comment (w3c/selection-api#99) `Selection.extend` has the similar issue and it seems that browsers work differently. However, I think the spec can allow to specify a point in different subtree root point with a pair of the container and the offset in it, but **cannot** allow to specify a point in a flattened tree specific point. For example, if a node is assigned to a `<slot>`, specifying the point should be the parent node of the node and offset of the node in the non-flattened tree rather than `<slot>` and index in the assigned node list. Otherwise, the implementations cannot distinguish whether the API caller intended a point in the flattened tree or the non-flattened tree. Similarly, the shadow host and an offset should not be treated as the shadow root and the offset in it. So, the spec needs to define the logic from a point in the non-flattened tree to one in the flattented tree. However, there is a problem, I tried to write the conversion for the internal use in Gecko, but there are probably 2 intentions about the offset. One is specifying after the previous child of the child at offset. The other is specifying the child at the offset directly. Currently, Gecko assumes the former if the point is collapsed or end boundary of a range and the latter if the point is start boundary of a range. https://searchfox.org/firefox-main/rev/c206271d981e72dac0fdd91625b2c0709129a7d6/dom/base/RangeBoundary.h#349-387 -- Reply to this email directly or view it on GitHub: https://github.com/w3c/selection-api/issues/99#issuecomment-3844754812 You are receiving this because you are subscribed to this thread. Message ID: <w3c/selection-api/issues/99/3844754812@github.com>
Received on Wednesday, 4 February 2026 01:41:04 UTC