Bug 205302 - -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the start of marked text
Summary: -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-16 14:48 PST by Wenson Hsieh
Modified: 2019-12-16 17:17 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.23 KB, patch)
2019-12-16 15:34 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 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.
Comment 1 Wenson Hsieh 2019-12-16 15:34:17 PST
Created attachment 385820 [details]
Patch
Comment 2 WebKit Commit Bot 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>
Comment 3 WebKit Commit Bot 2019-12-16 17:16:53 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-12-16 17:17:25 PST
<rdar://problem/57991560>