Bug 66630 - Selection cannot be set to only contain a non-spacing mark
Summary: Selection cannot be set to only contain a non-spacing mark
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://thottingal.in/bugs/js/selectio...
Depends on:
Reported: 2011-08-21 04:52 PDT by Santhosh Thottingal
Modified: 2011-08-22 11:09 PDT (History)
3 users (show)

See Also:

Sample HTML showing wrong selectionStart (714 bytes, text/html)
2011-08-21 04:52 PDT, Santhosh Thottingal
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.