summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrace Kloba <>2009-04-06 10:47:25 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-06 10:47:25 -0700
commitf7d36a7e44a7cd902f83bfc42d9da0f48d2be264 (patch)
treef91c442bf05b26d1841e8e98b42120ee2a8930fc
parent44d3a81ac387ca3c1ebbad279e3b31d7ac961398 (diff)
downloadexternal_webkit-f7d36a7e44a7cd902f83bfc42d9da0f48d2be264.zip
external_webkit-f7d36a7e44a7cd902f83bfc42d9da0f48d2be264.tar.gz
external_webkit-f7d36a7e44a7cd902f83bfc42d9da0f48d2be264.tar.bz2
AI 144661: Fix #175030. Preserve the zoom factor during refresh. Remove the code change in FrameLoader.cpp which was to preserve the zoom factor when we first did layout. Now we only use the initialZoomScale if it is a standard load. If it is history load, restoreScale() should be called before didFirstLayout(), in the other cases, like reload, refresh, replace, we don't change the zoom factor.
BUG=175030 Automated import of CL 144661
-rw-r--r--WebCore/loader/FrameLoader.cpp6
-rw-r--r--WebKit/android/jni/WebViewCore.cpp10
2 files changed, 7 insertions, 9 deletions
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 151ab37..edcdbf0 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -3492,13 +3492,7 @@ void FrameLoader::continueLoadAfterWillSubmitForm(PolicyAction)
void FrameLoader::didFirstLayout()
{
if (Page* page = m_frame->page())
-#ifdef ANDROID_HISTORY_CLIENT
- // this should match the logic in FrameStateCommittedPage, so that we
- // can restore the scroll position and view state as early as possible
- if ((isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload) && page->backForwardList())
-#else
if (isBackForwardLoadType(m_loadType) && page->backForwardList())
-#endif
restoreScrollPositionAndViewState();
m_firstLayoutDone = true;
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 256c1f0..7a60447 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -218,7 +218,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue->m_jsConfirm = GetJMethod(env, clazz, "jsConfirm", "(Ljava/lang/String;Ljava/lang/String;)Z");
m_javaGlue->m_jsPrompt = GetJMethod(env, clazz, "jsPrompt", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
m_javaGlue->m_jsUnload = GetJMethod(env, clazz, "jsUnload", "(Ljava/lang/String;Ljava/lang/String;)Z");
- m_javaGlue->m_didFirstLayout = GetJMethod(env, clazz, "didFirstLayout", "()V");
+ m_javaGlue->m_didFirstLayout = GetJMethod(env, clazz, "didFirstLayout", "(Z)V");
m_javaGlue->m_sendMarkNodeInvalid = GetJMethod(env, clazz, "sendMarkNodeInvalid", "(I)V");
m_javaGlue->m_sendNotifyFocusSet = GetJMethod(env, clazz, "sendNotifyFocusSet", "()V");
m_javaGlue->m_sendNotifyProgressFinished = GetJMethod(env, clazz, "sendNotifyProgressFinished", "()V");
@@ -704,13 +704,17 @@ void WebViewCore::didFirstLayout()
DEBUG_NAV_UI_LOGD("%s", __FUNCTION__);
LOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!");
- const WebCore::KURL& url = m_mainFrame->loader()->url();
+ WebCore::FrameLoader* loader = m_mainFrame->loader();
+ const WebCore::KURL& url = loader->url();
if (url.isEmpty())
return;
LOGV("::WebCore:: didFirstLayout %s", url.string().ascii().data());
+ WebCore::FrameLoadType loadType = loader->loadType();
+
JNIEnv* env = JSC::Bindings::getJNIEnv();
- env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_didFirstLayout);
+ env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_didFirstLayout,
+ loadType == WebCore::FrameLoadTypeStandard);
checkException(env);
DBG_NAV_LOG("call updateFrameCache");