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 more about developers: **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.

Our concern lies in having to add yet another API when that happens. There are increasingly more content that would warrant the support for multi-range selection: bidirectional text, flex box, etc... Since existing APIs are designed to work with multi-range selection, it would be only natural to parallel that in this API.


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

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

Received on Tuesday, 21 March 2023 21:25:39 UTC