diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
| commit | be01689f43cf6882cf670d33df49ead1f570c53a (patch) | |
| tree | 4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/WebKit/blackberry/Api/WebPage.cpp | |
| parent | a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff) | |
| download | qtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz | |
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/WebKit/blackberry/Api/WebPage.cpp')
| -rw-r--r-- | Source/WebKit/blackberry/Api/WebPage.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp index 5f8894548..684279e30 100644 --- a/Source/WebKit/blackberry/Api/WebPage.cpp +++ b/Source/WebKit/blackberry/Api/WebPage.cpp @@ -638,7 +638,13 @@ void WebPage::loadFile(const char* path, const char* overrideContentType) void WebPage::download(const Platform::NetworkRequest& request) { - d->load(request.getUrlRef().c_str(), 0, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, true, "", request.getSuggestedSaveName().c_str()); + vector<const char*> headers; + Platform::NetworkRequest::HeaderList& list = request.getHeaderListRef(); + for (unsigned i = 0; i < list.size(); i++) { + headers.push_back(list[i].first.c_str()); + headers.push_back(list[i].second.c_str()); + } + d->load(request.getUrlRef().c_str(), 0, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, headers.empty() ? 0 : &headers[0], headers.size(), false, false, true, "", request.getSuggestedSaveName().c_str()); } void WebPagePrivate::loadString(const char* string, const char* baseURL, const char* contentType, const char* failingURL) @@ -892,11 +898,17 @@ void WebPagePrivate::setLoadState(LoadState state) m_virtualViewportHeight = m_defaultLayoutSize.height(); } // Check if we have already process the meta viewport tag, this only happens on history navigation. + // For back/forward history navigation, we should only keep these previous values if the document + // has the meta viewport tag when the state is Committed in setLoadState. // Refreshing should keep these previous values as well. + static ViewportArguments defaultViewportArguments; + bool documentHasViewportArguments = false; FrameLoadType frameLoadType = FrameLoadTypeStandard; + if (m_mainFrame && m_mainFrame->document() && !(m_mainFrame->document()->viewportArguments() == defaultViewportArguments)) + documentHasViewportArguments = true; if (m_mainFrame && m_mainFrame->loader()) frameLoadType = m_mainFrame->loader()->loadType(); - if (!m_didRestoreFromPageCache && !(frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin)) { + if (!((m_didRestoreFromPageCache && documentHasViewportArguments) || (frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin))) { m_viewportArguments = ViewportArguments(); // At the moment we commit a new load, set the viewport arguments @@ -5618,6 +5630,8 @@ void WebPagePrivate::setCompositor(PassRefPtr<WebPageCompositorPrivate> composit } m_compositor = compositor; + if (m_compositor) + m_compositor->setPage(this); // The previous compositor, if any, has now released it's OpenGL resources, // so we can safely free the owned context, if any. @@ -5850,6 +5864,9 @@ void WebPagePrivate::destroyCompositor() if (!m_ownedContext) return; + // m_compositor is a RefPtr, so it may live on beyond this point. + // Disconnect the compositor from us + m_compositor->setPage(0); m_compositor.clear(); m_ownedContext.clear(); } |
