Bug 66630

Summary: Selection cannot be set to only contain a non-spacing mark
Product: WebKit Reporter: Santhosh Thottingal <santhosh.thottingal>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, junu.pv+public, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://thottingal.in/bugs/js/selectionstart.html
Attachments:
Description Flags
Sample HTML showing wrong selectionStart none

Description Santhosh Thottingal 2011-08-21 04:52:59 PDT
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)
Comment 1 Junaid P V 2011-08-22 04:16:36 PDT
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
Comment 2 Alexey Proskuryakov 2011-08-22 11:09:22 PDT
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.