summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-08-23 10:41:51 -0700
committerGeorge Mount <mount@google.com>2012-08-23 10:41:51 -0700
commitc657ea41ccfd187ba85feb78edcf4ac947afb2e7 (patch)
tree9d8f285da3296c4396844bee8ffba0b7cda531f7 /Source/WebKit/android/jni/WebViewCore.cpp
parent3dca44542840785fe67ba613c7fb0ded50e09bb4 (diff)
downloadexternal_webkit-c657ea41ccfd187ba85feb78edcf4ac947afb2e7.zip
external_webkit-c657ea41ccfd187ba85feb78edcf4ac947afb2e7.tar.gz
external_webkit-c657ea41ccfd187ba85feb78edcf4ac947afb2e7.tar.bz2
Text around selection falls back to caret rect when not in text.
Bug 7025068 When the input field is empty, the selection was appearing outside the input field. With this change, we fall back to the caret rect for the text around the caret. Change-Id: Ie6122ec34a0ae96994dc91b002bdcb3403b753eb
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp6
1 files changed, 3 insertions, 3 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);