diff options
author | Cary Clark <cary@android.com> | 2009-08-27 15:38:27 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-08-28 12:45:50 -0400 |
commit | 194211f214e16956c937d03c2aff03936c22f928 (patch) | |
tree | 7d08c210e996cbfd8b2be287939e7ab3d0df0a37 | |
parent | 035fa2b3882a318e4320698c8b343577b959fd51 (diff) | |
download | external_webkit-194211f214e16956c937d03c2aff03936c22f928.zip external_webkit-194211f214e16956c937d03c2aff03936c22f928.tar.gz external_webkit-194211f214e16956c937d03c2aff03936c22f928.tar.bz2 |
don't layout when setting size from zoom if only height changed
(companion change in framework/base)
Add a boolean parameter to WebViewCore.java nativeSizeSize().
If set, only layout if the width has also changed.
If clear, layout if the height alone has changed.
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 12 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 0a205da..3889b8e 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -959,7 +959,8 @@ void WebViewCore::setGlobalBounds(int x, int y, int h, int v) } void WebViewCore::setSizeScreenWidthAndScale(int width, int height, - int screenWidth, float scale, int realScreenWidth, int screenHeight) + int screenWidth, float scale, int realScreenWidth, int screenHeight, + bool ignoreHeight) { WebCoreViewBridge* window = m_mainFrame->view()->platformWidget(); int ow = window->width(); @@ -979,7 +980,7 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height, } m_maxXScroll = screenWidth >> 2; m_maxYScroll = (screenWidth * height / width) >> 2; - if (ow != width || oh != height || osw != screenWidth) { + if (ow != width || (!ignoreHeight && oh != height) || osw != screenWidth) { WebCore::RenderObject *r = m_mainFrame->contentRenderer(); DBG_NAV_LOGD("renderer=%p view=(w=%d,h=%d)", r, realScreenWidth, screenHeight); @@ -2236,7 +2237,8 @@ static void UpdateFrameCacheIfLoading(JNIEnv *env, jobject obj) } static void SetSize(JNIEnv *env, jobject obj, jint width, jint height, - jint screenWidth, jfloat scale, jint realScreenWidth, jint screenHeight) + jint screenWidth, jfloat scale, jint realScreenWidth, jint screenHeight, + jboolean ignoreHeight) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); @@ -2245,7 +2247,7 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height, LOGV("webviewcore::nativeSetSize(%u %u)\n viewImpl: %p", (unsigned)width, (unsigned)height, viewImpl); LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetSize"); viewImpl->setSizeScreenWidthAndScale(width, height, screenWidth, scale, - realScreenWidth, screenHeight); + realScreenWidth, screenHeight, ignoreHeight); } static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jint x, jint y) @@ -2769,7 +2771,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) SendListBoxChoices }, { "nativeSendListBoxChoice", "(I)V", (void*) SendListBoxChoice }, - { "nativeSetSize", "(IIIFII)V", + { "nativeSetSize", "(IIIFIIZ)V", (void*) SetSize }, { "nativeSetScrollOffset", "(III)V", (void*) SetScrollOffset }, diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 2c21a6f..47410f9 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -254,7 +254,8 @@ namespace android { void setGlobalBounds(int x, int y, int h, int v); void setSizeScreenWidthAndScale(int width, int height, int screenWidth, - float scale, int realScreenWidth, int screenHeight); + float scale, int realScreenWidth, int screenHeight, + bool ignoreHeight); /** * Handle key events from Java. |