summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2011-02-01 11:02:25 -0500
committerLeon Scroggins <scroggo@google.com>2011-02-01 13:25:06 -0500
commitf0e9fcf1b8d55a3cd054aeb9393618161c48b719 (patch)
tree719129c4a573cce90f7276c5baef91486f13d15e /WebKit/android/jni/WebViewCore.cpp
parent6bec8b1c3fd6c34edbfb13eaecdc8735bb0f616a (diff)
downloadexternal_webkit-f0e9fcf1b8d55a3cd054aeb9393618161c48b719.zip
external_webkit-f0e9fcf1b8d55a3cd054aeb9393618161c48b719.tar.gz
external_webkit-f0e9fcf1b8d55a3cd054aeb9393618161c48b719.tar.bz2
Pass an extra boolean with scrollTo message.
Bug:3411564 When the size changes, add a boolean to the scroll message to only honor the scroll in the case that the IME is actually showing. Requires a change to frameworks/base. Change-Id: Ie5645c0838a5c9e7c0a24be2dc42061a0cb534dc
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 8361c17..b329e3b 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -342,6 +342,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
#endif
m_isPaused = false;
m_screenOnCounter = 0;
+ m_onlyScrollIfImeIsShowing = false;
LOG_ASSERT(m_mainFrame, "Uh oh, somehow a frameview was made without an initial frame!");
@@ -349,7 +350,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue = new JavaGlue;
m_javaGlue->m_obj = env->NewWeakGlobalRef(javaWebViewCore);
m_javaGlue->m_spawnScrollTo = GetJMethod(env, clazz, "contentSpawnScrollTo", "(II)V");
- m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(II)V");
+ m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(IIZ)V");
m_javaGlue->m_scrollBy = GetJMethod(env, clazz, "contentScrollBy", "(IIZ)V");
m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V");
m_javaGlue->m_layersDraw = GetJMethod(env, clazz, "layersDraw", "()V");
@@ -947,9 +948,11 @@ void WebViewCore::scrollTo(int x, int y, bool animate)
// LOGD("WebViewCore::scrollTo(%d %d)\n", x, y);
JNIEnv* env = JSC::Bindings::getJNIEnv();
- env->CallVoidMethod(m_javaGlue->object(env).get(),
- animate ? m_javaGlue->m_spawnScrollTo : m_javaGlue->m_scrollTo,
- x, y);
+ if (animate)
+ env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_spawnScrollTo, x, y);
+ else
+ env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_scrollTo,
+ x, y, m_onlyScrollIfImeIsShowing);
checkException(env);
}
@@ -1322,8 +1325,11 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height,
// If this was in response to touching a textfield and showing the IME,
// the IME may now cover textfield. Bring it back into view.
// If the scale changed, however, this was the result of a zoom.
- if (oldScale == m_scale)
+ if (oldScale == m_scale && osh > screenHeight) {
+ m_onlyScrollIfImeIsShowing = true;
revealSelection();
+ m_onlyScrollIfImeIsShowing = false;
+ }
// update the currently visible screen as perceived by the plugin
sendPluginVisibleScreen();
}