Bug 205302

Summary: -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the start of marked text
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Wenson Hsieh
Reported 2019-12-16 14:48:11 PST
-[UIWKDocumentContext markedTextRange] wrong in almost all circumstances (the only exception is when the selection is a caret at the start of the composition range). This is partially due to logic in UIKit that attempts to compute -markedTextRange without considering the overlap between `contextBefore` and `markedText`, but also due to `selectedRangeInMarkedText` being wrong, since distanceBetweenPositions(A, B) returns a negative value if A comes before B.
Attachments
Patch (9.23 KB, patch)
2019-12-16 15:34 PST, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-12-16 15:34:17 PST
WebKit Commit Bot
Comment 2 2019-12-16 17:16:51 PST
Comment on attachment 385820 [details] Patch Clearing flags on attachment: 385820 Committed r253602: <https://trac.webkit.org/changeset/253602>
WebKit Commit Bot
Comment 3 2019-12-16 17:16:53 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 4 2019-12-16 17:17:25 PST
Note You need to log in before you can comment on or make changes to this bug.