If we still have a valid caret position, use it to give priority to a region of text. We now take the text before the caret, instead of the text at the end of the field. If the caret is not present, we start from the beginning of the field. this helps learning in email where the region of interest is generally at the start, not end of the field.
Created attachment 184264 [details] Patch
Comment on attachment 184264 [details] Patch LGTM.
Comment on attachment 184264 [details] Patch Clearing flags on attachment: 184264 Committed r140564: <http://trac.webkit.org/changeset/140564>
All reviewed patches have been landed. Closing bug.