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[1], 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[2]. We have a workaround but that is very inefficient. [1] http://www.mediawiki.org/wiki/Extension:Narayam [2] https://bugzilla.wikimedia.org/show_bug.cgi?id=30130
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.