Changeset 133522 in webkit
- Timestamp:
- Nov 5, 2012 1:59:44 PM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r133517 r133522 1 2012-11-05 Lianghui Chen <liachen@rim.com> 2 3 [BlackBerry] Do not display error page for failed downloads 4 https://bugs.webkit.org/show_bug.cgi?id=101246 5 6 Internal PR: 236318 7 Internal reviewed by Joe Mason, Leo Yang. 8 Reviewed by Rob Buis. 9 10 Right now when a main load, including all downloads, failed, it will 11 display an error page. This is not very user friendly, especially for 12 WebWorks application, which want to use its own user interface to info 13 user about the failure. 14 So we just stop displaying error page for downloads. 15 16 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 17 (WebCore::FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad): 18 1 19 2012-11-05 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r133199 r133522 710 710 return; 711 711 712 String errorPage = m_webPagePrivate->m_client->getErrorPage(error.errorCode(), error.localizedDescription(), error.failingURL());713 714 712 // Make sure we're still in the provisionalLoad state - getErrorPage runs a 715 713 // nested event loop while it's waiting for client resources to load so 716 714 // there's a small window for the user to hit stop. 717 if (m_frame->loader()->provisionalDocumentLoader()) { 718 SubstituteData errorData(utf8Buffer(errorPage), "text/html", "utf-8", KURL(KURL(), error.failingURL())); 719 720 ResourceRequest originalRequest = m_frame->loader()->provisionalDocumentLoader()->originalRequest(); 721 722 // Loading using SubstituteData will replace the original request with our 723 // error data. This must be done within dispatchDidFailProvisionalLoad, 724 // and do NOT call stopAllLoaders first, because the loader checks the 725 // provisionalDocumentLoader to decide the load type; if called any other 726 // way, the error page is added to the end of the history instead of 727 // replacing the failed load. 728 // 729 // If this comes from a back/forward navigation, we need to save the current viewstate 730 // to original historyitem, and prevent the restore of view state to the error page. 731 if (isBackForwardLoadType(m_frame->loader()->loadType())) { 732 m_frame->loader()->history()->saveScrollPositionAndViewStateToItem(m_frame->loader()->history()->currentItem()); 733 ASSERT(m_frame->loader()->history()->provisionalItem()); 734 m_frame->loader()->history()->provisionalItem()->viewState().shouldSaveViewState = false; 735 } 736 m_loadingErrorPage = true; 737 m_frame->loader()->load(originalRequest, errorData, false); 738 } 715 if (!m_frame->loader()->provisionalDocumentLoader()) 716 return; 717 718 ResourceRequest originalRequest = m_frame->loader()->provisionalDocumentLoader()->originalRequest(); 719 720 // Do not show error page for a failed download. 721 if (originalRequest.forceDownload()) 722 return; 723 724 String errorPage = m_webPagePrivate->m_client->getErrorPage(error.errorCode(), error.localizedDescription(), error.failingURL()); 725 SubstituteData errorData(utf8Buffer(errorPage), "text/html", "utf-8", KURL(KURL(), error.failingURL())); 726 727 // Loading using SubstituteData will replace the original request with our 728 // error data. This must be done within dispatchDidFailProvisionalLoad, 729 // and do NOT call stopAllLoaders first, because the loader checks the 730 // provisionalDocumentLoader to decide the load type; if called any other 731 // way, the error page is added to the end of the history instead of 732 // replacing the failed load. 733 // 734 // If this comes from a back/forward navigation, we need to save the current viewstate 735 // to original historyitem, and prevent the restore of view state to the error page. 736 if (isBackForwardLoadType(m_frame->loader()->loadType())) { 737 m_frame->loader()->history()->saveScrollPositionAndViewStateToItem(m_frame->loader()->history()->currentItem()); 738 ASSERT(m_frame->loader()->history()->provisionalItem()); 739 m_frame->loader()->history()->provisionalItem()->viewState().shouldSaveViewState = false; 740 } 741 742 m_loadingErrorPage = true; 743 m_frame->loader()->load(originalRequest, errorData, false); 739 744 } 740 745
Note: See TracChangeset
for help on using the changeset viewer.