Bug 144501 - Back/forward navigation to an error page in Safari breaks the back-forward list
Summary: Back/forward navigation to an error page in Safari breaks the back-forward list
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-01 14:45 PDT by mitz
Modified: 2015-05-01 16:48 PDT (History)
6 users (show)

See Also:


Attachments
Handle error page loads in the context of the provisional load error that triggered them (26.39 KB, patch)
2015-05-01 16:16 PDT, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2015-05-01 14:45:26 PDT
<rdar://problem/8636045>

To reproduce:

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.
Comment 1 mitz 2015-05-01 14:46:57 PDT
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.
Comment 2 mitz 2015-05-01 16:16:21 PDT
Created attachment 252188 [details]
Handle error page loads in the context of the provisional load error that triggered them
Comment 3 mitz 2015-05-01 16:48:31 PDT
Fixed in <http://trac.webkit.org/r183698>.