diff options
author | George Mount <mount@google.com> | 2013-05-01 15:24:08 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-01 15:24:08 -0700 |
commit | f10a189dce4aae6292c15b90e102bfd2db464afb (patch) | |
tree | 7f2cc25d129c19f92dc670391f12db2b9b0d8927 | |
parent | d6d669001139891ceaa73033dc7a6abe4797ddd5 (diff) | |
parent | 2fec4ff3dd57cda25cbcb9a009a745dd49173c0a (diff) | |
download | webkit-f10a189dce4aae6292c15b90e102bfd2db464afb.tar.gz |
am 2fec4ff3: Keep LTR selection within the text range.
* commit '2fec4ff3dd57cda25cbcb9a009a745dd49173c0a':
Keep LTR selection within the text range.
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 497cc9a9c..6a2982320 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -4223,6 +4223,14 @@ Vector<VisibleSelection> WebViewCore::getTextRanges( VisiblePosition endSelect = visiblePositionForContentPoint(endX, endY); Position start = startSelect.deepEquivalent(); Position end = endSelect.deepEquivalent(); + if (isLtr(end)) { + // The end caret could be just to the right of the text. + endSelect = visiblePositionForContentPoint(endX - 1, endY); + Position newEnd = endSelect.deepEquivalent(); + if (!newEnd.isNull()) { + end = newEnd; + } + } Vector<VisibleSelection> ranges; if (!start.isNull() && !end.isNull()) { if (comparePositions(start, end) > 0) { |