Re: [w3c/editing] Expose event.getTargetRanges() in oncompositionstart (and possibly oncompositionend as well) (Issue #511)

johanneswilm left a comment (w3c/editing#511)

The point of `getTargetRanges()` is to get the ranges that an event covers over - which may not always be the same as the selection. It was first introduced for input events as a new way to get static ranges in a way that is more memory efficient than dynamic selection objects.  `beforeinput` and `compositionstart` are two different types of events and the meaning of their target ranges would therefore be somewhat different, but I don't see why it would be wrong to also expose target ranges for `compositionstart` even if its meaning is different.

The question then is if in the case of `compositionstart`, the target ranges are always exactly the same as the selection. If one can be sure that they are always the exact same thing, then there is arguably not a need for another method to additionally also get the target ranges. @michael In the video example above, what is the selection at the time of `compositionstart`? 

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

Message ID: <w3c/editing/issues/511/3544696118@github.com>

Received on Tuesday, 18 November 2025 02:03:24 UTC