1. Make a new Safari empty window
2. Type a bogus address in the Smart Search Field (e.g. "http://bad.example") and hit Return to get a page-load error page
3. Type a real address in the Smart Search Field (e.g. "http://apple.com") and hit Return to visit the real page
4. click Back to go back to the error page
At this point the Back button should be disabled, and the Forward button should be enabled. But instead, the Back button is enabled, and the Forward button is disabled. Clicking and holding the Back button shows an extra “Failed to open page” item in the Back list. Clicking the Back button again doesn’t anything.
The mechanism that is supposed to prevent this is FrameLoader::shouldReloadToHandleUnreachableURL. The special handling only kicks in if the error page is being loaded synchronously from beneath dispatchDidFailProvisionalLoad. That is not the case when using WebKit2, because dispatchDidFailProvisionalLoad returns immediately after sending a message to the UI process, and the latter later calls back to load the error page.
I am going to fix this by sending the necessary context along to the UI process and restoring it if and when we load the error page from within the UI’s process handling of the error.
Created attachment 252188 [details]
Handle error page loads in the context of the provisional load error that triggered them
Fixed in <http://trac.webkit.org/r183698>.