Bug 188422

Summary: Disallow navigations when page cache updates the current document of the frame
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Page LoadingAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, beidson, cdumez, ews-watchlist, japhet, koivisto, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch and layout test rniwa: review+

Description Daniel Bates 2018-08-08 15:34:30 PDT
As part of restoring a page from the page cache we call Frame::setDocument() to re-associate the cached document into its frame. Frame::setDocument() triggers render tree construction and post style resolution callbacks that can do anything, including navigating child frames before we have restored them (and hence re-attached them to the frame tree). For example, pages embedded via an HTML object element are loaded from a post style resolution callback. We should not perform navigations during page restore.
Comment 1 Daniel Bates 2018-08-08 17:14:48 PDT
Created attachment 346804 [details]
Patch and layout test
Comment 2 Ryosuke Niwa 2018-08-16 16:07:15 PDT
Comment on attachment 346804 [details]
Patch and layout test

View in context: https://bugs.webkit.org/attachment.cgi?id=346804&action=review

> LayoutTests/fast/history/go-back-to-object-subframe.html:22
> +window.onpageshow = runTest;

We should probably mention in the change log that we're not preventing navigation during pageshow event.
Comment 3 Daniel Bates 2018-08-16 16:09:13 PDT
(In reply to Ryosuke Niwa from comment #2)
> Comment on attachment 346804 [details]
> Patch and layout test
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=346804&action=review
> 
> > LayoutTests/fast/history/go-back-to-object-subframe.html:22
> > +window.onpageshow = runTest;
> 
> We should probably mention in the change log that we're not preventing
> navigation during pageshow event.

Will add the following remark to the change log entry in LayoutTests/ChangeLog:

This change does not prevent navigations initiated from a pageshow event handler.
Comment 4 Daniel Bates 2018-08-21 09:50:30 PDT
Committed r235121: <https://trac.webkit.org/changeset/235121>
Comment 5 Radar WebKit Bug Importer 2018-08-21 09:51:25 PDT
<rdar://problem/43565212>