[Webkit-unassigned] [Bug 66120] New: Incorrect data retrieved in calls to get selection data in client->textWillBeReplaced() from CharacterData::setDataAndUpdate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 11 17:58:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66120

           Summary: Incorrect data retrieved in calls to get selection
                    data in client->textWillBeReplaced() from
                    CharacterData::setDataAndUpdate
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.7
            Status: NEW
          Keywords: InRadar
          Severity: Normal
          Priority: P2
         Component: HTML Editing
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jonlee at apple.com


The call to textWillBeReplaced() in CharacterData::setDataAndUpdate() is performed before the text node gets updated, and before the document is notified that text has been removed.

textWillBeReplaced() updates the selection, which in turn notifies the client. If the client decides to retrieve the selection, or create a Range based on the data or selection, the client would retrieve incorrect data for the following reasons:

1) Since the DOM node has not been updated yet, the desired selection/caret might be outside of the available DOM range. (For example, if the user types a character)

2) Any ranges created by the client into the document would get adjusted by the textRemoved() call.

It would seem to make sense to move the textWillBeReplaced() call to after the textRemoved() call, but I would appreciate some input as to why this call is made when it is made.

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



More information about the webkit-unassigned mailing list