Bug 188422 - Disallow navigations when page cache updates the current document of the frame
Summary: Disallow navigations when page cache updates the current document of the frame
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-08 15:34 PDT by Daniel Bates
Modified: 2018-08-21 09:51 PDT (History)
8 users (show)

See Also:


Attachments
Patch and layout test (4.98 KB, patch)
2018-08-08 17:14 PDT, Daniel Bates
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>