summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/nav/WebView.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-02-02 13:16:04 -0800
committerJohn Reck <jreck@google.com>2012-02-02 14:03:14 -0800
commitdf71abcaa1e7975b2fbc7522d006829223093825 (patch)
tree995032adc1fc3ef290a069293f0b9a8588173005 /Source/WebKit/android/nav/WebView.cpp
parent97616e122163d8573c1fb93084ea469bc23d396a (diff)
downloadexternal_webkit-df71abcaa1e7975b2fbc7522d006829223093825.zip
external_webkit-df71abcaa1e7975b2fbc7522d006829223093825.tar.gz
external_webkit-df71abcaa1e7975b2fbc7522d006829223093825.tar.bz2
Snap selection handles to end of text
Instead of using WebKit's cursor location use the start and end of the text highlight region since we only highlight text and not other content like images Change-Id: I1b84b8a0be34c56e87169d215c581fdada745362
Diffstat (limited to 'Source/WebKit/android/nav/WebView.cpp')
-rw-r--r--Source/WebKit/android/nav/WebView.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index efdb67f..62cc6ce 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -1420,15 +1420,16 @@ int getHandleLayerId(SelectText::HandleId handleId, SkIRect& cursorRect) {
if (!selectText)
return -1;
int layerId = selectText->caretLayerId(handleId);
- const IntRect& r = selectText->caretRect(handleId);
- cursorRect.set(r.x(), r.y(), r.maxX(), r.maxY());
+ IntRect rect = selectText->caretRect(handleId);
if (layerId != -1) {
+ // We need to make sure the drawTransform is up to date as this is
+ // called before a draw() or drawGL()
+ m_baseLayer->updateLayerPositions(m_visibleRect);
LayerAndroid* root = compositeRoot();
LayerAndroid* layer = root ? root->findById(layerId) : 0;
- IntPoint offset;
- WebViewCore::layerToAbsoluteOffset(layer, offset);
- cursorRect.offset(offset.x(), offset.y());
+ rect = layer->drawTransform()->mapRect(rect);
}
+ cursorRect.set(rect.x(), rect.y(), rect.maxX(), rect.maxY());
return layerId;
}