Created attachment 330426 [details] iOS 10.3 video capture This bug probably happens for single page web apps. I have attached 2 video shots for iOS 10.3 and iOS 11.1 to show the difference in behavior. I can reproduce the issue at outschool.com: - Go to https://outschool.com/online-classes - Click one of the class images to see the class detail page - Use swipe back gesture to go to previous page - Previous page renders empty for a couple of seconds and then appears fully rendered Other remarks: - This issue does not happen on iOS 10.3. There is still a short freeze of full UI but more acceptable than the current situation on iOS 11.1 - This issue does not happen for websites which are not single page apps. Try news.ycombinator.com as an example. - This issue does not happen when regular back button is used instead of swiping
Created attachment 330427 [details] iOS 11.1 video capture
<rdar://problem/35110344>
My fix for twitter seems to fix this site too, so I’ll use this bug (I’ve also confirmed that this site uses scrollRestoration and pushState, so it makes sense).
Created attachment 330877 [details] Patch
Created attachment 330924 [details] Patch
Created attachment 330929 [details] Patch
Created attachment 330930 [details] Patch
Comment on attachment 330930 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330930&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:321 > + std::optional<uint64_t> _firstTransactionIDAfterPageRestore; We really need a typedef for transactionIDs, or maybe use Identified or something. > LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html:9 > +history.scrollRestoration = "manual"; Maybe you should have a basic swipe test without scrollRestoration as well. > LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html:29 > + measuredDurationShouldBeLessThan("snapshotRemoval", 1000, "Because we're using the page cache, it shouldn't be long between the gesture completing and the snapshot being removed.") I wonder how flakey this will be on bots.
(In reply to Simon Fraser (smfr) from comment #8) > Comment on attachment 330930 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=330930&action=review > > > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:321 > > + std::optional<uint64_t> _firstTransactionIDAfterPageRestore; > > We really need a typedef for transactionIDs, or maybe use Identified or > something. Yes. > > LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html:9 > > +history.scrollRestoration = "manual"; > > Maybe you should have a basic swipe test without scrollRestoration as well. Probably! > > LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html:29 > > + measuredDurationShouldBeLessThan("snapshotRemoval", 1000, "Because we're using the page cache, it shouldn't be long between the gesture completing and the snapshot being removed.") > > I wonder how flakey this will be on bots. If it comes up, we can replace this with a bit that disables the watchdog, and just let the test time out altogether.
Comment on attachment 330930 [details] Patch Attachment 330930 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6023578 New failing tests: swipe/pushstate-with-manual-scrollrestoration.html
Created attachment 330946 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Bug tracking the test failing on Mac (it’s pretty specific to the test): https://bugs.webkit.org/show_bug.cgi?id=181502. Going to skip the test on Mac for now.
Created attachment 330975 [details] Patch
https://trac.webkit.org/changeset/226750/webkit
<rdar://problem/36424175>