diff options
author | George Mount <mount@google.com> | 2012-08-27 13:04:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-27 13:04:14 -0700 |
commit | d2b6abb0b5522a20810fde546d0167ca04c66649 (patch) | |
tree | 1cac1e65ba2ca4a136fb073f7c7bfa16819945af | |
parent | ae7d73128baa76b45c16886913891a8a3c0baee3 (diff) | |
parent | c657ea41ccfd187ba85feb78edcf4ac947afb2e7 (diff) | |
download | external_webkit-d2b6abb0b5522a20810fde546d0167ca04c66649.zip external_webkit-d2b6abb0b5522a20810fde546d0167ca04c66649.tar.gz external_webkit-d2b6abb0b5522a20810fde546d0167ca04c66649.tar.bz2 |
Merge "Text around selection falls back to caret rect when not in text." into jb-mr1-dev
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 920119b..aa38222 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -1576,7 +1576,7 @@ void WebViewCore::setSelectionCaretInfo(SelectText* selectTextContainer, selectTextContainer->setCaretRect(handleId, caretRect); selectTextContainer->setHandleType(handleId, handleType); selectTextContainer->setTextRect(handleId, - positionToTextRect(pos, affinity, offset)); + positionToTextRect(pos, affinity, offset, caretRect)); } bool WebViewCore::isLtr(const Position& position) @@ -1684,9 +1684,9 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection) } IntRect WebViewCore::positionToTextRect(const Position& position, - EAffinity affinity, const WebCore::IntPoint& offset) + EAffinity affinity, const WebCore::IntPoint& offset, const IntRect& caretRect) { - IntRect textRect; + IntRect textRect = caretRect; InlineBox* inlineBox; int offsetIndex; position.getInlineBoxAndOffset(affinity, inlineBox, offsetIndex); diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 6e3604d..4e223b3 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -728,7 +728,8 @@ namespace android { WebCore::IntRect absoluteClientRect(WebCore::Node* node, WebCore::LayerAndroid* layer); static WebCore::IntRect positionToTextRect(const WebCore::Position& position, - WebCore::EAffinity affinity, const WebCore::IntPoint& offset); + WebCore::EAffinity affinity, const WebCore::IntPoint& offset, + const WebCore::IntRect& caretRect); static bool isLtr(const WebCore::Position& position); static WebCore::VisiblePosition trimSelectionPosition( const WebCore::VisiblePosition& start, |