Created attachment 104626 [details]
Sample HTML showing wrong selectionStart
Open the attached html in the browser and see the alert. The input field has a two character cluster with a combining character MALAYALAM VIRAMA
ഷ + ് => ഷ്
When we try to select at position range (1,2), Following are the results
- Chrome: FAILS by returning 2,2 - returns the position after the cluster.
- Firefox: OK - returns 1,2
- Konqueror: OK - returns 1,2
- IE: (not supported)
As part of our Mediawiki extension Narayam, we have to use selectionStart for its efficient working. Currently no support for webkit browsers as of this bug. Alse see the bug report 30130 at bugzilla of Wikemedia projects.
We have a workaround but that is very inefficient.
The bug title is incorrect. It's not that selectionStart returns a wrong value. Selection range is actually set to (2, 2), because (1, 2) is not a meaningful selection from user point of view.
We have other bugs asking not to validate selection that was set programmatically. See bug 15256 and related ones.