summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-07-08 17:32:41 -0700
committerGrace Kloba <klobag@google.com>2009-07-08 17:32:41 -0700
commitcb86952d254446a800421b5804f886f8d87cd875 (patch)
tree3aab03d95004e74a824c35ea427af29e661990cc
parentb116c1a08412db8a748998c7e8a2ce851cbacacd (diff)
downloadexternal_webkit-cb86952d254446a800421b5804f886f8d87cd875.zip
external_webkit-cb86952d254446a800421b5804f886f8d87cd875.tar.gz
external_webkit-cb86952d254446a800421b5804f886f8d87cd875.tar.bz2
Fix #1896846. Move reset the meta data from canHandleRequest to transitionToCommittedForNewPage as canHandleRequest may not trigger to go to a new page. For example, if a link is to open in a new window, even canHandleRequest returns true, the current page doesn't switch to a new page. So we should not reset the meta data.
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index d8d45fe..5a07278 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -643,15 +643,7 @@ bool FrameLoaderClientAndroid::canHandleRequest(const ResourceRequest& request)
m_frame->tree() && m_frame->tree()->parent())
return true;
- if (m_webFrame->canHandleRequest(request)) {
-#ifdef ANDROID_META_SUPPORT
- // reset metadata settings for the top frame as they are not preserved cross page
- if (!m_frame->tree()->parent() && m_frame->settings())
- m_frame->settings()->resetMetadataSettings();
-#endif
- return true;
- }
- return false;
+ return m_webFrame->canHandleRequest(request);
}
bool FrameLoaderClientAndroid::canShowMIMEType(const String& mimeType) const {
@@ -773,6 +765,13 @@ void FrameLoaderClientAndroid::transitionToCommittedFromCachedFrame(WebCore::Cac
void FrameLoaderClientAndroid::transitionToCommittedForNewPage() {
ASSERT(m_frame);
+
+#ifdef ANDROID_META_SUPPORT
+ // reset metadata settings for the main frame as they are not preserved cross page
+ if (m_frame == m_frame->page()->mainFrame() && m_frame->settings())
+ m_frame->settings()->resetMetadataSettings();
+#endif
+
if (m_frame->settings() && !m_frame->settings()->usesPageCache()) {
m_webFrame->transitionToCommitted(m_frame);
return;