Bug 67464

Summary: Invalid selection made temporarily when entering text in textfield
Product: WebKit Reporter: Sadrul Habib Chowdhury <sadrul>
Component: HTML EditingAssignee: Varun Jain <varunjain>
Severity: Normal CC: ap, fsamuel, leandro, rjkroege, rniwa, varunjain
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Sadrul Habib Chowdhury 2011-09-01 21:24:54 PDT
Reproduction steps:

 * Enter some text in a textfield.
 * Press 'Home' to go to the beginning of the textfield.
 * Press any key to insert some text.

FrameSelection::selection becomes invalid, because it returns true from isRange() in WebCore::EditorClient::respondToChangedSelection callback.

The following comment for VisibleSelection::setWithoutValidation may be of interest (or maybe not):

// FIXME: This function breaks the invariant of this class.
// But because we use VisibleSelection to store values in editing commands for use when
// undoing the command, we need to be able to create a selection that while currently
// invalid, will be valid once the changes are undone. This is a design problem.
// To fix it we either need to change the invariants of VisibleSelection or create a new
// class for editing to use that can manipulate selections that are not currently valid.
Comment 1 Robert Kroeger 2011-09-02 07:28:02 PDT
Varun: I think you ought to take a look at this eventually.
Comment 2 Ryosuke Niwa 2011-09-08 15:11:38 PDT
Also see https://bugs.webkit.org/show_bug.cgi?id=62092.
Comment 3 Ryosuke Niwa 2013-02-03 14:16:53 PST
I think we've fixed this bug in the latest WebKit. Could you check that?
Comment 4 Varun Jain 2013-02-04 11:06:53 PST
(In reply to comment #3)
> I think we've fixed this bug in the latest WebKit. Could you check that?

yes.. I dont see this anymore.
Comment 5 Ryosuke Niwa 2013-02-04 11:33:52 PST

*** This bug has been marked as a duplicate of bug 62092 ***