- From: Mason Freed <notifications@github.com>
- Date: Wed, 21 Aug 2024 13:53:09 -0700
- To: w3c/selection-api <selection-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/selection-api/issues/169/2302993537@github.com>
> As per https://dontcallmedom.github.io/webdex/v.html#valid%40%40StaticRange%40dfn the valid concept is used in https://drafts.csswg.org/css-highlight-api-1/ which is also what we added it for. I haven't done detailed review myself though. Ahh ok, thanks for the pointer. So the highlight API takes either `Range`s or `StaticRanges`, and has [this](https://drafts.csswg.org/css-highlight-api-1/#:~:text=When%20computing%20how%20to%20render%20a%20document%2C%20if%20start%20node%20or%20end%20node%20of%20any%20range) additional text: > When computing how to render a document, if [start node](https://dom.spec.whatwg.org/#concept-range-start-node) or [end node](https://dom.spec.whatwg.org/#concept-range-end-node) of any [range](https://dom.spec.whatwg.org/#concept-range) in the [highlight registry](https://drafts.csswg.org/css-highlight-api-1/#highlight-registry) associated with that document’s window refer to a [Node](https://dom.spec.whatwg.org/#node) whose [shadow-including root](https://dom.spec.whatwg.org/#concept-shadow-including-root) is not that document, the user agent must ignore that range. If any [StaticRange](https://dom.spec.whatwg.org/#staticrange) in the highlight registry associated with that document’s window is not [valid](https://dom.spec.whatwg.org/#staticrange-valid), the user agent must ignore that range. From that paragraph (and the explicit usage of shadow including root specifically), it sounds like the intention was actually to support ranges that cross shadow boundaries, no? I suppose there's a risk of compat problems if we change the definition of `valid` for `StaticRange`, based on this API. But that would seem to be a fairly corner case usage. My expectation is that more often, the opposite is true - developers create a StaticRange that crosses shadow bounds and then get confused when it isn't `valid`. If there are other references to StaticRange, it'd be good to look at each of them to analyze compat. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/selection-api/issues/169#issuecomment-2302993537 You are receiving this because you are subscribed to this thread. Message ID: <w3c/selection-api/issues/169/2302993537@github.com>
Received on Wednesday, 21 August 2024 20:53:13 UTC