-[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.
Created attachment 385820 [details]
Comment on attachment 385820 [details]
Clearing flags on attachment: 385820
Committed r253602: <https://trac.webkit.org/changeset/253602>
All reviewed patches have been landed. Closing bug.