Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r183698 - Back/forward navigation to an error page in Safari br…
…eaks the back-forward list https://bugs.webkit.org/show_bug.cgi?id=144501 Reviewed by Darin Adler. Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm Normally, loading substitute data (such as an error page) creates a new back-forward list item. FrameLoader has a mechanism that detects when a substitute data load occurs during handling of a provisional load error and prevents the creation of a new back-forwards list item in that case if the unreachable URL is the same as the failing provisional URL. This mechanism was broken in WebKit2, where handling the provisional load error is asynchronous. The fix is to capture some state (namely, the failing provisional URL) when dispatching the load error and allow it to be restored when loading the substitute data. * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): Removed initialization of m_delegateIsHandlingProvisionalLoadError. (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s URL, check m_provisionalLoadErrorBeingHandledURL. (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL. * loader/FrameLoader.h: (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client can call this from its override of dispatchDidFailProvisionalLoad and store the result. (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The client can call this prior to loading substitute data if it’s done as part of handling a previously-dispatched didFailProvisionalLoad. Source/WebKit2: WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list https://bugs.webkit.org/show_bug.cgi?id=144501 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of failure. (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep it in new member variable m_failingProvisionalLoadURL for the duration of the client’s handling of this message. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to DidFailProvisionalLoadForFrame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error to the UI process. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to reflect the provisional load error being handled. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to LoadAlternateHTMLString.
- Loading branch information
1 parent
c568fcb
commit e7a82c6
Showing
13 changed files
with
191 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.