summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-01-13 19:19:47 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-01-13 19:19:47 -0800
commit4b178ce71c24ed77a43970be3e7ebb99ed41fa27 (patch)
treef2206e8ad85cdf8f42d7e2682b099b9f52d6e3c8 /WebKit/android
parent625ef54c9e40168e824ee100fc6d3cb90c99b39f (diff)
parentf48712a096831a3b85a5e18dabd44a541f6b4712 (diff)
downloadexternal_webkit-4b178ce71c24ed77a43970be3e7ebb99ed41fa27.zip
external_webkit-4b178ce71c24ed77a43970be3e7ebb99ed41fa27.tar.gz
external_webkit-4b178ce71c24ed77a43970be3e7ebb99ed41fa27.tar.bz2
am f48712a0: DO NOT MERGE.
Merge commit 'f48712a096831a3b85a5e18dabd44a541f6b4712' into eclair-plus-aosp * commit 'f48712a096831a3b85a5e18dabd44a541f6b4712': DO NOT MERGE.
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp53
1 files changed, 28 insertions, 25 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 0eca9bc..d13abe5 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1074,32 +1074,35 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height,
DBG_NAV_LOGD("renderer=%p view=(w=%d,h=%d)", r,
realScreenWidth, screenHeight);
if (r) {
- WebCore::IntPoint anchorPoint;
- if ((anchorX | anchorY) == 0)
- // get current screen center position
- anchorPoint = WebCore::IntPoint(m_scrollOffsetX
- + (realScreenWidth >> 1), m_scrollOffsetY
- + (screenHeight >> 1));
- else
- anchorPoint = WebCore::IntPoint(anchorX, anchorY);
- WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()->
- hitTestResultAtPoint(anchorPoint, false);
- WebCore::Node* node = hitTestResult.innerNode();
+ WebCore::Node* node = 0;
WebCore::IntRect bounds;
- WebCore::IntPoint offset;
- if (node) {
- bounds = node->getRect();
- DBG_NAV_LOGD("ob:(x=%d,y=%d,w=%d,h=%d)",
- bounds.x(), bounds.y(), bounds.width(), bounds.height());
- if ((anchorX | anchorY) == 0) {
- offset = WebCore::IntPoint(anchorPoint.x() - bounds.x(),
- anchorPoint.y() - bounds.y());
- if (offset.x() < 0 || offset.x() > realScreenWidth ||
- offset.y() < 0 || offset.y() > screenHeight)
- {
- DBG_NAV_LOGD("offset out of bounds:(x=%d,y=%d)",
- offset.x(), offset.y());
- node = 0;
+ if (osw) {
+ WebCore::IntPoint anchorPoint;
+ if ((anchorX | anchorY) == 0)
+ // get current screen center position
+ anchorPoint = WebCore::IntPoint(m_scrollOffsetX
+ + (realScreenWidth >> 1), m_scrollOffsetY
+ + (screenHeight >> 1));
+ else
+ anchorPoint = WebCore::IntPoint(anchorX, anchorY);
+ WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()->
+ hitTestResultAtPoint(anchorPoint, false);
+ node = hitTestResult.innerNode();
+ if (node) {
+ bounds = node->getRect();
+ DBG_NAV_LOGD("ob:(x=%d,y=%d,w=%d,h=%d)",
+ bounds.x(), bounds.y(), bounds.width(), bounds.height());
+ if ((anchorX | anchorY) == 0) {
+ WebCore::IntPoint offset = WebCore::IntPoint(
+ anchorPoint.x() - bounds.x(), anchorPoint.y()
+ - bounds.y());
+ if (offset.x() < 0 || offset.x() > realScreenWidth ||
+ offset.y() < 0 || offset.y() > screenHeight)
+ {
+ DBG_NAV_LOGD("offset out of bounds:(x=%d,y=%d)",
+ offset.x(), offset.y());
+ node = 0;
+ }
}
}
}