summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-12-04 10:53:31 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-12-04 10:53:31 -0800
commit9401c651f24855ce1db6a286789c55f796221e35 (patch)
tree7bc8d394b8d514757311fd143eb2364af80d7660 /WebKit/android
parentf4b04b8d9c8b8aeb33ca4641594f7f0f7dc06505 (diff)
parent49b2fbe0299cb92d13e2be317a59cb0881b221fc (diff)
downloadexternal_webkit-9401c651f24855ce1db6a286789c55f796221e35.zip
external_webkit-9401c651f24855ce1db6a286789c55f796221e35.tar.gz
external_webkit-9401c651f24855ce1db6a286789c55f796221e35.tar.bz2
Merge change I49b2fbe0 into eclair-mr2
* changes: Only re-center the page if it is zoom change or orientation change. Do not re-center the page if it is caused by show/hide soft keyboard.
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index f138662..4e3d8bf 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1100,11 +1100,18 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height,
WebCore::IntPoint screenCenter = WebCore::IntPoint(
m_scrollOffsetX + (realScreenWidth >> 1),
m_scrollOffsetY + (screenHeight >> 1));
- WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()->
- hitTestResultAtPoint(screenCenter, false);
- WebCore::Node* node = hitTestResult.innerNode();
+ WebCore::Node* node = 0;
WebCore::IntRect bounds;
WebCore::IntPoint offset;
+ // If the screen width changed, it is probably zoom change or
+ // orientation change. Try to keep the node in the center of the
+ // screen staying at the same place.
+ if (osw != screenWidth) {
+ WebCore::HitTestResult hitTestResult =
+ m_mainFrame->eventHandler()-> hitTestResultAtPoint(
+ screenCenter, false);
+ node = hitTestResult.innerNode();
+ }
if (node) {
bounds = node->getRect();
DBG_NAV_LOGD("ob:(x=%d,y=%d,w=%d,h=%d)",