Re: [w3c/selection-api] getComposedRange() review (Issue #161)

> > Interesting! Is there an issue discussing why getComposedRanges() plural, that returns a [sequence] that seems to always just contain one StaticRange?
> 
> Also it simplifies Gecko's implementation since we probably need to make them able to return multiple ranges.

I get that it simplifies Gecko's implementation, and it makes no implementation difference for Chromium/WebKit who only support a single selection. My concern is that **a)** multiple ranges are only supported on a single browser at the moment, and **b)** due to (a) I'm guessing there is an overwhelming volume of web code that just blindly does `Selection.getRangeAt(0)`. I.e. it hard codes that there's only one range. Given that multiple ranges isn't therefore an interoperable use case, I'm loathe to bake it in further by returning multiple ranges from this new API. If we eventually end up standardizing multiple ranges for real, we can/should cross that bridge when we come to it. Until then, let's make sure selection works interoperably as much as possible today, and also simplify the API for developers, by just returning a single range. 

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

Message ID: <w3c/selection-api/issues/161/1470990930@github.com>

Received on Wednesday, 15 March 2023 23:48:06 UTC