[Webkit-unassigned] [Bug 13795] New: Can't create range from "double-clicked" selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 21 03:57:19 PDT 2007


           Summary: Can't create range from "double-clicked" selection
           Product: WebKit
           Version: 522+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: Blocker
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: fabriceperrinel at gmail.com

Please help because it starts to turns me mad...
When selecting text by double clicking in a word,
var selection = getSelection()
result in the same value for baseOffset and extentOffset, that is, the exact
place between two chars where the dblclick occured.
However, the "true" selection may exists actually "somewhere" because :
selection.type returns "Range",
selection.isCollapsed accordingly returns "False",
selection.toString() correctly returns the "visually" selected string (which is
and in a "contentEditable" context, I can perfom operations on it...

The only way I found to retrive the selection is :
var selstring = selection.toString()
Collapse selection to its baseOffset and extentOffset points (which are the
same actually).
Then extent selection backward until it matches the start of selstring.
Then extent forward until its length matches the length of selstring.



Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list